SJames Posted August 31, 2007 Share Posted August 31, 2007 I have a search function like this: SELECT * FROM page_content WHERE title like '%$term%' $term is defined through GET data. This works fine untill the user enters something with capitilization that differs from the way it is spelled in the database. Is there a way to use SELECT and ignore the capitilization? Quote Link to comment https://forums.phpfreaks.com/topic/67413-mysql-capitilization/ Share on other sites More sharing options...
Ken2k7 Posted August 31, 2007 Share Posted August 31, 2007 Just say title='$term' By default, the database queries are case-insensitive. Quote Link to comment https://forums.phpfreaks.com/topic/67413-mysql-capitilization/#findComment-338432 Share on other sites More sharing options...
SJames Posted August 31, 2007 Author Share Posted August 31, 2007 Well I want the search to find results that include the terms but don't have to be exactly the same. And the capitilization does make a difference apparently. Ex: A search for "one" will return "title one", but a search for "One" will not. Quote Link to comment https://forums.phpfreaks.com/topic/67413-mysql-capitilization/#findComment-338435 Share on other sites More sharing options...
Ken2k7 Posted August 31, 2007 Share Posted August 31, 2007 Oh sorry, use WHERE instead of LIKE Quote Link to comment https://forums.phpfreaks.com/topic/67413-mysql-capitilization/#findComment-338438 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.