CodeIgniter Forums
LIKE without a wildcard - 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: LIKE without a wildcard (/showthread.php?tid=21682)



LIKE without a wildcard - El Forum - 08-17-2009

[eluser]Cheater[/eluser]
http://codeigniter.com/bug_tracker/bug/8152/

Can someone confirm that that bug report is correct?

It is where you are trying to do a SQL LIKE query, without any wildcards.
CodeIgniter cannot currently do that. It must insert a wildcard.

Its needed when want to do a case-insensitive search in MySQL.


LIKE without a wildcard - El Forum - 08-18-2009

[eluser]davidbehler[/eluser]
Can't you use
Code:
LCASE(col_1) = LCASE('abc')
instead of
Code:
col_1 LIKE 'abc'

Should be the same, or not?


LIKE without a wildcard - El Forum - 08-18-2009

[eluser]Cheater[/eluser]
Functionality wise yes its equivalent, but worse performance wise.

LIKE 'abc' uses indexes for a case insensitive search while LCASE would require to make every individual row lower case and then do the comparison.


LIKE without a wildcard - El Forum - 08-18-2009

[eluser]davidbehler[/eluser]
Ok, performance wise it suxx..you are right.
But those out there that don't want to edit core files could use that solution until the "bug" is fixed/the missing feature is added.