CodeIgniter Forums

Full Version: need a help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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

El Forum

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

El Forum

[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

El Forum

[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

El Forum

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