Can anyone solve this? I'm having trouble...
I'm coding a search field with numerous values, where it's only necessary for one value to be entered.
For example:
The field has inputs for name, email, address, and phone number.
But the admin can just type the name or just the email and it will bring back all the matching values.
Right now, I'm using code like this:
$result = mysql_query("SELECT * FROM customers
WHERE name='$name'
OR email='$email'
OR address='$address'
OR phone='$phone'
or die(mysql_error());
But when I run this through a loop, it brings back more values than the one that should apply to the search criteria.
For example, if I type 'John', it brings back 'John' at the top, then a bunch that are not 'John'.
Does anyone know what's going wrong?