CodeIgniter Forums
active record where() - 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: active record where() (/showthread.php?tid=14051)



active record where() - El Forum - 12-16-2008

[eluser]Unknown[/eluser]
codeigniter 1.7
$this->db->where("role='admin' OR role='superadmin'");

produces:

WHERE `role='admin'` OR role='superadmin'

note the extra quotes


active record where() - El Forum - 12-16-2008

[eluser]Derek Allard[/eluser]
did you use the third parameter?

Quote:$this->db->where() accepts an optional third parameter. If you set it to FALSE, CodeIgniter will not try to protect your field or table names with backticks.