When I enter a wrong query from the database such as entering an actors name which is not in the database, the output is a blank screen. The following is the code:
$resul1 = mysql_query("select website from actors where name = '$find_actor';");
if (!$resul1) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Actor: '.$find_actor.' does not exist.' . $query;
die($message);
}
else {
while ($row = mysql_fetch_array($resul1)) {
echo "The actor, ".$find_actor." website is ".$row[0];
}
}
So, entering a name which is in the database, I get the correct results. The problem, however, is that entering a name no in the database leads to a white blank screen.
I’m supposed to get the $message result, but do not.
Thank You.
1 Answer