vomitbomb Posted May 12, 2008 Share Posted May 12, 2008 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">'; } Link to comment https://forums.phpfreaks.com/topic/105237-solved-running-script-even-when-theres-no-results/ Share on other sites More sharing options...
bilis_money Posted May 12, 2008 Share Posted May 12, 2008 because you already called die() function before the redirect. the die() will terminate the current script Link to comment https://forums.phpfreaks.com/topic/105237-solved-running-script-even-when-theres-no-results/#findComment-538862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.