<HTML>
<HEAD>
<TITLE>Re: [Phpwm] MySQL case insensitive string comparison</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>There isn't a iLike in Mysql. :o(<BR>
<BR>
I’ve stated to use<BR>
<BR>
select * from table where lower(name) = lower(‘$value’) <BR>
<BR>
Which works but that doesn’t seem a very efficient way of tying to get it to behave as it should be behaving in the first place.<BR>
<BR>
<BR>
<BR>
<BR>
On 24/06/2010 13:49, "Dan Dart" <<a href="dandart@googlemail.com">dandart@googlemail.com</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Have you tried using the lower/upper/camel case instructions in PHP to make MySQL see what you want?<BR>
<BR>
Jolly confusing how it all seems to contradict itself.<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>On 24 Jun 2010 13:39, "Mike Tipping" <<a href="mike@etuna.co.uk">mike@etuna.co.uk</a>> wrote:<BR>
<BR>
Whenever I run a select in Mysql based on a string comparison, the<BR>
comparison is always case sensitive so where 'name' in the DB is 'mike',<BR>
select * from table where name = 'MIKE'; won't return results.<BR>
<BR>
Looking at the MySQL documentation it says that case sensitivity on<BR>
comparisons depends on the collation and if I use 'latin1_swedish_ci' (which<BR>
I do) the comparison will be case insensitive (which it isn't).<BR>
<BR>
It also says that STRCMP() is by default case insensitive, but when I try<BR>
that it still doesn't return anything.<BR>
<BR>
Any ideas what I might be doing wrong or what I can use to do a case<BR>
insensitive string comparison in MySQL.<BR>
<BR>
Cheers<BR>
<BR>
Mike<BR>
<BR>
<BR>
<BR>
_______________________________________________<BR>
Phpwm mailing list<BR>
Website : <a href="http://www.phpwm.org">http://www.phpwm.org</a><BR>
Twitter : <a href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a><BR>
Facebook: <a href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a><BR>
<BR>
Post to list: <a href="Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a><BR>
Archive etc : <a href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a><BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"></SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'>_______________________________________________<BR>
Phpwm mailing list<BR>
Website : <a href="http://www.phpwm.org">http://www.phpwm.org</a><BR>
Twitter : <a href="http://www.twitter.com/phpwm">http://www.twitter.com/phpwm</a><BR>
Facebook: <a href="http://www.facebook.com/group.php?gid=2361609907">http://www.facebook.com/group.php?gid=2361609907</a><BR>
<BR>
Post to list: <a href="Phpwm@mailman.lug.org.uk">Phpwm@mailman.lug.org.uk</a><BR>
Archive etc : <a href="https://mailman.lug.org.uk/mailman/listinfo/phpwm">https://mailman.lug.org.uk/mailman/listinfo/phpwm</a><BR>
</SPAN></FONT></FONT></BLOCKQUOTE>
</BODY>
</HTML>