I have a query that looks like this:
SELECT species, comname
FROM passerines
WHERE species LIKE '%varspecies%' AND comname LIKE '%varcomname%'
varspecies
value = 1
runtime value= $HTTP_GET_VARS['varspecies']
varcomname, same basically as as varspecies but with change of name.
In my search form, if I put a search value in one of the fields that has no approximate corresponding value in the database I get the message "No results found" which is exactly what I am supposed to get.
However, if I leave the search form blank, without adding values, and then press submit...all the records are listed on the results page.
I am not clear how to tell it if both (in this case) search text boxes are left empty "No results found" should appear just like mentioned above.
Any advice?
query returns all records in error
Moderator: General Moderators