Manipulating the way a db Query is generated .. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Manipulating the way a db Query is generated .. (/showthread.php?tid=47812) |
Manipulating the way a db Query is generated .. - El Forum - 12-23-2011 [eluser]Unknown[/eluser] Hi, is there a way to manipulate the way a db query is built .. I would like to use the LIKE operator with a wildcard `%` instead of the equal `=` operator to generate queries like Code: SELECT * FROM (`drivers`) WHERE `first_name` LIKE 'D%' AND `active` = 1 ORDER BY `id` instead of Code: SELECT * FROM (`drivers`) WHERE `first_name` = 'David' AND `active` = 1 ORDER BY `id` This is how the query is being constructed from a search form Code: .. |