Hi - I have, what I thought when I set out, a very simple problem but when I implemented it it just didn't work.
I have a property data base and I have divided the island up into three "rings" - Costal, Middle and Mountian.
When people put their property IN then they can only choose one naturally but
When people want to search I have included 3 check boxes so that they can search multiple rings, eg coast and mountian.
I am doing something wrong because when I use the code below I either get only all the db entries or none depending on whether I use "AND" or "OR" ..... I am guessing I have to do something to another part of teh code.
$result = mysql_query("select * from db WHERE
....... AND
(ring LIKE '%".$ring1."%' OR ring LIKE '%".$ring2."%' OR ring LIKE '%".$ring3."%') AND
.......
The rest of the code works
The ring1, ring2 and ring3 come from the form and are the names of the different check boxes which have the checked values of Costal, Middle and Mountian .
Any suggestions? This should be simple but I am stumped.
Thanks a lot.
Jon