I guess I wasn't too clear on that was I? Sorry about that.
The example above is a search query for users on the site. They will be able to use the included form to do a search for a flight, or a list of flights, based on the search fields (ie, Flight Number, Hub, Aircraft, etc).
If someone uses the form and fills out something in every field, then of course the search query works fine.
However... if a user elects to not fill in a field (such as Aircraft, Departure time, etc), I want that empty field to work as a wildcard.
So, for example, lets say I searched for a flight, but didn't know the flight number. When I searched the database, I only filled out the Flight Hub and Flight Departure ICAO fields. All the other fields I left blank. In this example... every one of the blank fields need to be wildcard variables.
Basically... to explain it another way, any blank field needs to run as a wildcard variable in the query if it is left empty.
I hope this makes sense...
In regards to my PHP query script I know that it won't work as it is now. I've tried many things to get this to work like I need it to and what I had as the $search query before was a standard "SELECT" query with all the fields as variables (ie, "SELECT * FROM table WHERE flight_num = '$rnum' AND flight_hub = '$rhub'... etc)... which of course doesn't work if any field is left blank.