this works if you put the correct $propid in but if you put the wrong one it comes up with Could not connect to database (because nothing exist but i want it to redirect if npthing exists. andy one able to help please.
thanks.
aron.
if($psearch == 'psearch_yes')
{
$sql_pid = "SELECT * FROM Listings WHERE property_id = $propid";
$sql_result_pid = mysql_query($sql_pid,$connection) or die ("Could not connect to database");
if(mysql_num_rows($sql_result_pid)==0){
header("Location: index.php?error=no_prop");
exit(); //in case redirection doesn't work
}
$line_pid = mysql_fetch_array($sql_result_pid);
$property_id = $line_pid["id"];
}