I have a database table with 4 columns, let's say (animal_type, animal_breed, color, sex) and none of these can be null values when entered.
I have a form that has 4 fields (2 select boxes for type and sex, 2 text boxes for color and breed) that searches the table based on the criteria provided and returns the results.
What I'm wondering is whether or not there is a way to have a single query return the results I want even if I don't put something in each form field. (ie. show all black dogs regardless or breed or sex or show all female animals regardless of other criteria)
my SQL skills are ok, but the only ways I can see to do this is with multiple queries.
I have a form that has 4 fields (2 select boxes for type and sex, 2 text boxes for color and breed) that searches the table based on the criteria provided and returns the results.
What I'm wondering is whether or not there is a way to have a single query return the results I want even if I don't put something in each form field. (ie. show all black dogs regardless or breed or sex or show all female animals regardless of other criteria)
my SQL skills are ok, but the only ways I can see to do this is with multiple queries.