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. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
SCook Posted July 3, 2007 Author Share Posted July 3, 2007 Can you give me a sample? Quote Link to comment 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.