![]() |
escape string problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: escape string problem (/showthread.php?tid=14692) |
escape string problem - El Forum - 01-12-2009 [eluser]tim1965[/eluser] I am trying to query my database using a variable $uname which i pull from a session. If i dump the variable it looks like this Quote:string(7) "tom4444". Quote:When i run my query $this->db->select('property_id')->from('master_property_reference')->where('username',$uname); $query = $this->db->get(); I get the following error message Quote:string(7) "tim1965" object(CI_DB_mysql_result)#15 (7) { ["conn_id"]=> resource(45) of type (mysql link persistent) ["result_id"]=> resource(55) of type (mysql result) ["result_array"]=> array(0) { } ["result_object"]=> array(0) { } ["current_row"]=> int(0) ["num_rows"]=> int(1) ["row_data"]=> NULL } Quote: I am guessing that it is blowing up on the double quotes in the variable, but i thought these were escaped automatically using active records. My db is Quote:username varchar(12) property_id mediumint(20) date_time_created timestamp ad_completed varchar(1) Quote:Can anybody see anything i am missing ? escape string problem - El Forum - 01-12-2009 [eluser]tim1965[/eluser] Please ignore above. The query was correctly inserting. |