Hi I've set up a website which gathers results from a mysql database which allows the user to sort the results according to some preferences in 2 separate select lists.
It works as long as you make a selection from both boxes before submitting.
I would like for results to be shown if the user makes a selection from only one of the lists.
This is the code I am using right now; I can see why it only displays results if all menus have selected options but haven't a clue how to alter it to do as I wish.
$bedrooms=$_POST['bedrooms'];
$bathrooms=$_POST['bathrooms'];
$query=
"SELECT *
FROM inventory
WHERE bedrooms like '$bedrooms' AND bathrooms like '$bathrooms'
ORDER BY model_name ASC";
Can anyone help me out?