I want to create a form with a number of price ranges, where the results can be included in a query. For instance, checkbox 1 will be between 10 and 20, checkbox 2 will be between 20 and 30, etc.
I have been able to parse the form results, but am coming up with a problem when I try to put the values in a query. It works OK if one range is selected, but fails when two ranges are passed on. It doesn't seem to like running two between conditions in the query. For example;
Code: Select all
select * from products WHERE price BETWEEN '10' AND '20' AND price BETWEEN '30' AND '40'Any experts out there that can point me in the right direction? Your help would be greatly appreciated.