I need to do a single keyword search that searches multiple columns in the same table (and across another table) for example :
Table> ID First Name, Last Name, Cel, Fax etc
I need to search all of those fields at once.
How do I use one search box/query to search for multiple records searching all those columns/fields at once?
Thanks
mysql searching
Moderator: General Moderators
Well, you can add restrictions on the returned rows with the WHERE clause.
And you can use AND and OR to add multiple restrictions...
And you can use AND and OR to add multiple restrictions...
Code: Select all
SELECT * FROM table WHERE col1='bar' OR col2='bar'
SELECT * FROM table WHERE col1='foo' AND col2='foo'