Jump to content

[SOLVED] Running script even when there's no results.


vomitbomb

Recommended Posts

Why doesn't this return me to my main page when there are no results?

 

$sql = "SELECT * FROM orders WHERE lname='$search'";
$result = mysql_query($sql, $conn);
if (!$result) {
    die('Invalid query: ' . mysql_error());
echo 'Redirecting to main page.<meta http-equiv="refresh" content="2;url=index.html">';
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.