![]() |
trying to check username and password in database - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: trying to check username and password in database (/showthread.php?tid=45432) |
trying to check username and password in database - El Forum - 09-21-2011 [eluser]Unknown[/eluser] hello, i am trying to check username and password from db but i am getting this error " Parse error: parse error in \application\models\loginusermodel.php on line 14" my code for model is:- $this -> db -> select(' UserName, Password'); 7 $this -> db -> from('users'); 8 $this -> db -> where('UserName = ' . "'" . $this->input->post(UserName) . "'"); 9 $this -> db -> where('Password = ' . "'" . $$this->input->post(UserPass) . "'"); 10 $this -> db -> limit(1); 11 12 $query = $this -> db -> get(); 13 14 if($query -> num_rows() == 1) 15 { 16 return $query->result(); 17 } 18 else 19 { 20 return false; 21 } thanks, |