22 lines
407 B
PHP
22 lines
407 B
PHP
|
<?php
|
||
|
class User_model extends CI_Model {
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->load->database();
|
||
|
}
|
||
|
|
||
|
public function create_user($data)
|
||
|
{
|
||
|
return $this->db->insert('user', $data);
|
||
|
}
|
||
|
|
||
|
public function get_user_by_email($email)
|
||
|
{
|
||
|
$this->db->where('email', $email);
|
||
|
$query = $this->db->get('user');
|
||
|
return $query->row_array();
|
||
|
}
|
||
|
}
|
||
|
?>
|