CodeIgniter Forums
need a help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: need a help (/thread-33394.html)



need a help - El Forum - 08-24-2010

[eluser]samitrimal[/eluser]
hi!
i am bob.This is the first time i am using the codeigniter. i got the following error.
what error is it?
Fatal error: Call to undefined method CI_DB_mysql_driver::escape_string() in I:\xampp\htdocs\codeshopping\system\application\models\adminmodel.php on line 13


need a help - El Forum - 08-24-2010

[eluser]CI_avatar[/eluser]
whats in your code? please post it so someone could easily help you.


need a help - El Forum - 08-25-2010

[eluser]samitrimal[/eluser]
This is my model class .

Code:
function CheckUserLogin($user,$pass){
      //  $user=$this->db->escape_string($user);
        ///$pass=$this->db->escape_string($pass);
       // $this->db->select('username,userpass');
        $this->db->where('username',$user);
        $this->db->where('userpass',$pass);
      $result= $this->db->get('tbl_admin');
It shows error when i remove comment of
Code:
$this->db->escape_string

Regards,
bob


need a help - El Forum - 08-25-2010

[eluser]davidbehler[/eluser]
You don't have to escape the strings yourself, $this->db->where already does that for you.

Apart from that here is no escape_string method, it's called escape_str


need a help - El Forum - 08-25-2010

[eluser]samitrimal[/eluser]
Thank you for a help.
regards,
bob