20 lines
		
	
	
		
			383 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			383 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
class User_model extends CI_Model {
 | 
						|
 | 
						|
    public function __construct() {
 | 
						|
        $this->load->database();
 | 
						|
    }
 | 
						|
 | 
						|
    public function get_user_by_email($email) {
 | 
						|
        $query = $this->db->get_where('users', ['email' => $email]);
 | 
						|
        return $query->row_array();
 | 
						|
    }
 | 
						|
 | 
						|
    public function create_user($data) {
 | 
						|
        return $this->db->insert('users', $data);
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
?>
 |