wmguk Posted March 18, 2009 Share Posted March 18, 2009 Hey, I'm running this script: $sql = "SELECT * FROM clients, contacts WHERE clients.company LIKE '%$search%' OR contacts.name LIKE '%$search%'" ; $result = mysql_query($sql); however its not doing the right thing.... if I pass the name John to the page, i need to see all records where john is in the company name OR where john is in the contact name can anyone help? Quote Link to comment https://forums.phpfreaks.com/topic/149995-simple-or-qry-error/ Share on other sites More sharing options...
drisate Posted March 18, 2009 Share Posted March 18, 2009 however its not doing the right thing.... What is it doing? Quote Link to comment https://forums.phpfreaks.com/topic/149995-simple-or-qry-error/#findComment-787735 Share on other sites More sharing options...
Zane Posted March 18, 2009 Share Posted March 18, 2009 however its not doing the right thing.... So what IS it doing then? instead Quote Link to comment https://forums.phpfreaks.com/topic/149995-simple-or-qry-error/#findComment-787736 Share on other sites More sharing options...
Zane Posted March 18, 2009 Share Posted March 18, 2009 however its not doing the right thing.... What is it doing? haha...nice Quote Link to comment https://forums.phpfreaks.com/topic/149995-simple-or-qry-error/#findComment-787737 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.