help with this error im getting please.
here is the error
Warning: Invalid argument supplied for foreach() in c:\inetpub\wwwroot\eliteagents\prop_search.php on line 27
Could not connect to database
this is the url
hxxp://localhost/eliteagents/prop_search.php?pricefrom=1&priceto=100000000&property=Any&bed=100&nav=search&order=price&select5=100&suburbs%5B%5D=ACACIA+RIDGE&suburbs%5B%5D=ANNERLEY&suburbs%5B%5D=ANSTEAD&suburbs%5B%5D=BARELLAN+POINT&suburbs%5B%5D=BRACKEN+RIDGE&Submit=Submit
this is the code.
$nav = isset($_GET['nav']);
$order = isset($_GET['order']);
$property = isset($_GET['property']);
$suburbs = isset($_GET['suburbs']);
$pricefrom = isset($_GET['pricefrom']);
$priceto = isset($_GET['priceto']);
$beds = isset($_GET['beds']);
$bath = isset($_GET['bath']);
if($order == 'id'){
$ad = "DESC";
}else{
$ad = "ASC";
}
if($nav == 'search'){
$size = count($suburbs);
$count1 = 1;
$sql_2 = "";
foreach($suburbs as $suburbsElement)
{
$sql_2 .= ("'$suburbsElement'");
if ($count1 < $size)
{
$sql_2 .= (', ');
}
$count1++;
}
cheers aron.