I have created a form where users select search values from a combination of textfields and checkboxes. The text field part is fine but I can't get the checkboxes to return any values from the query. Basically the checkboxes have a selected value of 'sony', 'panasonic', etc
<input type="checkbox" name="sony" ... value="sony" />
<input type="checkbox" name="panasonic" ... value="panasonic" />
So if the 'sony' checkbox is selected then all products with that name in the 'brand' column called 'sony' be selected. If both checkboxes are selected then both 'sony' and 'panasonic' brands are selected.
The default values for the brands is 0.
Thanks for help
FROM products, details
WHERE products.prod_id = details.prod_id AND (price BETWEEN 'minprice' AND 'maxprice') AND (brand = 'brand1' OR 'brand1' = '0') AND (colour = 'brand' OR 'brand2' = '0')
ORDER BY name, price ASC