Ok, I have a form with things like last name, first name, phone number, etc.
I need for my php script to search through my mysql database, but only if the user entered something into the given field. So if they only entered a first name it would only find the entries in the database with that first name. None of the fields are required.
How can I either search for all the entries with a first name, and then search those results for all the entries with the specified last name and so on, or just do one search where i check before hand to see if there are entries in each field and if there are not, simply put a wildcard in that field in the query.
Basically I would like to "build" the query as I check each field to see if anything is there. Any Ideas?