PHP/MYSQL CASE QUESTION?

in my search engine script, i have the “select * from table1 where column1 like %$_POST[search]% or column2 like etc”. But when i conduct the search, things appear to be case sensitive. For example, when searching for date, e.g. June, if i typed june, i could not find anything, only if i typed June.
i could use the “strtoupper” function like:
$_POST[search]=strtoupper($_POST[search]); before the query above, and then search all in CAPS?
any other solutions which will make things case insensitive?
or put differently: how do you make a query result case insensitive?
about 1 year ago
just try this code
“select * from table1 where column1 like ‘%$_POST[search]%’”
bsc your query is string not integer thats why your query not working properly.
Thanks
about 1 year ago
like is case sensitive so your sql should be like:
$_POST[search]=strtoupper($_PO…
select * from table1 where upper(column1) like ‘%$_POST[search]%’ …
This is not the most eficient way of searching because upper has to be computed for the complete table each time.
You can solve this adding column to store upper version of the column or try using full text search functions
http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html