SCook Posted July 3, 2007 Share Posted July 3, 2007 Is there a way to query a sql table and compare a string without the case sensitivity being an issue? For example, if I do this: select * from companies where occupation like '%web%' and city like '%Orlando%' and state = 'FL'; I get nothing, but if I do this: select * from companies where occupation like '%Web%' and city like '%Orlando%' and state = 'FL'; I get the desired result. I realize this is more a sql question, but as this is part of a php search script, perhaps there's a solution. Thanks. Link to comment https://forums.phpfreaks.com/topic/58274-php-and-mysql-query/ Share on other sites More sharing options...
GingerRobot Posted July 3, 2007 Share Posted July 3, 2007 As far as im aware, mysql is case insensitive anyway. Link to comment https://forums.phpfreaks.com/topic/58274-php-and-mysql-query/#findComment-288941 Share on other sites More sharing options...
AndyB Posted July 3, 2007 Share Posted July 3, 2007 Binary comparison is needed. http://www.mysql.org/doc/refman/4.1/en/case-sensitivity.html View the user notes. Link to comment https://forums.phpfreaks.com/topic/58274-php-and-mysql-query/#findComment-288943 Share on other sites More sharing options...
SCook Posted July 3, 2007 Author Share Posted July 3, 2007 Can you give me a sample? Link to comment https://forums.phpfreaks.com/topic/58274-php-and-mysql-query/#findComment-289002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.