CodeIgniter Forums
like_having() for active record - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: like_having() for active record (/showthread.php?tid=6509)



like_having() for active record - El Forum - 03-01-2008

[eluser]BlueCamel[/eluser]
Can we get a like() function for the HAVING clause in active record? Maybe we could rename the existing or_like() and like() to or_where_like() and where_like() then add or_having_like() and having_like() functions?

I'm not sure about SQL standards, but in MySQL at least it's perfect valid to write HAVING col like '%foo%'.


like_having() for active record - El Forum - 03-02-2008

[eluser]xwero[/eluser]
having can take the same conditions as where so maybe it would have the same methods as the latter. To keep the api small my Compress AR where methods suggestion could come in handy. The where, or_where, having and or_having can be interface methods for _where_conditions that delegates the conditions to the appropriate arrays.