Advertisement
dewa_01

Untitled

Dec 15th, 2019
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  2.  
  3. class Model_users extends CI_Model {
  4.  
  5.     public function check_credential()
  6.     {
  7.         $username = set_value('username');
  8.         $password = set_value('password');
  9.        
  10.         $hasil = $this->db->where('username', $username)
  11.                           ->where('password', $password)
  12.                           ->limit(1)
  13.                           ->get('users');
  14.        
  15.         if($hasil->num_rows() > 0){
  16.             return $hasil->row();
  17.         } else {
  18.             return array();
  19.         }
  20.     }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement