Jump to content

simple OR qry error?


wmguk

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/149995-simple-or-qry-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.