![]() |
Problem with where clause in active record class (solved) - 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: Problem with where clause in active record class (solved) (/showthread.php?tid=44305) |
Problem with where clause in active record class (solved) - El Forum - 08-10-2011 [eluser]Unknown[/eluser] $params['title'] is a string and $params['feed'] is an integer. Column's 'title' type is varchar and column's 'feed' type is integer. The PHP code is: Code: $this->db->where('title', $params['title']); So everything should be fine, BUT... Quote:A Database Error Occurred Of course, it's obvious why an error occurred. Solved by changing to Code: $this->db->where('title', (string) $params['title']); Why CI didn't automatically determine the syntax of the SQL query? Using CI 2.0.2 and MySQL 5.5.10 EDIT $params['title'] is a property of object created by SimpleXML and that property's type is object, not string. Fixed. |