first commit
This commit is contained in:
19
application/models/UserModel.php
Normal file
19
application/models/UserModel.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user