olshop/application/models/UserModel.php

19 lines
410 B
PHP
Raw Permalink Normal View History

2020-01-02 23:12:35 +07:00
<?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();
}
}