Advertisement
Thalutn5

Untitled

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