Hello
I have a search form that forces you to search for one country and one region from a mysql database.
It all worked fine except that now I have tried to complicate it so that each database record could potentially be associated with multiple countries and/or regions. Here's the bit I think is going wrong.
$country=$_GET['country'];
$location=$_GET['location'];
$sql = "SELECT holiday.locationid, location.locationid, loaction.location, holiday.countryid country.countryid, country.country FROM holiday, country, location WHERE holiday.countryid = country.countryid AND holiday.locationid = location.locationid";
if ($country <> 'Any'){
$sql .= " AND holiday.countryid LIKE '%*$country*%'";
}
if ($location <> 'Any'){
$sql .= " AND holiday.locationid LIKE '%*$location*%'";
}
The db table 'holiday' has columns for 'countryid' and 'locationid' stored as an array and they look something like this:
countryid: 13
locationid: 1610*
I think it's going wrong on the bit where it compares holiday.countryid = country.countryid because it's comparing an integer with an array. Any ideas how I could solve this please?
Thank you.