im trying to do a product filter in php via checkboxes, basically i could get it to display the products with one filter, but i am lost in how to make multiple checkboxes to work with eachother.
here's what i've tried:
the part where it changes the sql command
if (isset($_GET['checkDress'])){
if (empty($where)){
$where=" where category = 'kleit'";
}elseif(!empty($where)){
$where.=" and category = 'kleit'";
}
}
if (isset($_GET['nightDress'])){
if (empty($where)){
$where=" where category = 'oKleit'";
}elseif(!empty($where)){
$where.=" and category = 'oKleit'";
}
}
the sql command :
$res=mysql_query("select * from items $where $filter");
checking one of the checkboxes is fine, it returns the correct result, but checking 2 at the same time doesn't return anything at all. Any help would be very appreciated.