I'm trying to do a search FORM that will use an SQL query to bring back all results in a table.
My query is looking for a Buyers Name, Phone Number, and Location. I want the query to return the results for the Buyer Name (Required field), but I want them to have the option to put the phone number and location too. The query should return the results no matter if phone number or location are entered just so long as the Buyers Name is correct. How do I do that or use "OR" or optional results in that way with MYSQL? Here is a worded example that might help understand what I want to do.
SELECT *
FROM BuyersTable
WHERE Name must MATCH however LOCATION and PHONE can be empty.
This is for a FORM on a webpage that users will enter the information in textboxes that will POST to a php script.
My query is looking for a Buyers Name, Phone Number, and Location. I want the query to return the results for the Buyer Name (Required field), but I want them to have the option to put the phone number and location too. The query should return the results no matter if phone number or location are entered just so long as the Buyers Name is correct. How do I do that or use "OR" or optional results in that way with MYSQL? Here is a worded example that might help understand what I want to do.
SELECT *
FROM BuyersTable
WHERE Name must MATCH however LOCATION and PHONE can be empty.
This is for a FORM on a webpage that users will enter the information in textboxes that will POST to a php script.