I'm very new to this and although your answer makes some sense I'm not sure how to implement this in what I have already.
Currently I have a page with dynamically generated checkboxes from the lookup tables (yep 2!) and pass them to the result page which looks like this:
$select = "SELECT villa.vID, vName, vAdd1, vTown, vCountry";
$from = " FROM `villa`, `catlookup`, `amenlookup`";
$where_cat = " WHERE villa.vID=catlookup.vID AND villa.vID=amenlookup.vID AND catID=$cats[0]";
$where_am = " AND amenID=$ams[0]";
if (!$cats) {
echo "No categories chosen";
} elseif (!$ams) {
echo "No amenities chosen";
} else
{
while(list($keyc, $Cat) = each($cats))
{
$where_cat .= " AND $Cat";
}
while(list($keya, $Am) = each($ams))
{
$where_am .= " AND $Am";
}
$query = ($select . $from . $where_cat . $where_am);
Thanks for your help Lars