Hi.
On Sun, Feb 17, 2002 at 09:10:24AM -0700, [EMAIL PROTECTED] wrote:
> Since my first posting of this came out all screwed up,
>
> I currently have a PHP script performing the following query:
> mysql_query("SELECT * FROM Stuff WHERE Release LIKE \"%$var2%\"",$var1)
>
> It works great except that the search is coming out case sensitive.
> According to the MySQL Docs all searches are done without case
> sensitivity.
Well, not completely. The default is case insensitivity, but depending
on the context, you get case sensitive comparisons. See also
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#String_comparison_functions
(and the following section)
E.g. the behaviour you describe would be expected if Release has a
column type that is regarded BINARY (like BLOB).
> I just have 2 questions:
>
> 1) I think the syntax I'm using is correct but incase it's not what is
> the correct syntax for a case insensitive search?
See the next section of the above link. It suggest casting to
uppercase for forcing case insensitive compares.
>
> 2) What version of MySQL did the default of case insensitive searches
> begin as I'm using 3.23.31.
LIKE is case insensitive per default since 3.20.17 according to
http://www.mysql.com/documentation/mysql/bychapter/manual_News.html
Bye,
Benjamin.
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php