19 lines
410 B
PHP
19 lines
410 B
PHP
<?php
|
|
class UserModel extends CI_Model{
|
|
|
|
function tambah($data)
|
|
{
|
|
return $this->db->insert('user',$data);
|
|
}
|
|
function tambah_profil($data)
|
|
{
|
|
if($this->db->insert('profil',$data)){
|
|
return $this->db->insert_id();
|
|
}else return 0;
|
|
}
|
|
function login($data)
|
|
{
|
|
$query = $this->db->get_where('users', array('username' => $data['username'],'pass'=>$data['password']), 1);
|
|
return $query->row();
|
|
}
|
|
} |