$postQuery = $conn->query("SELECT * from table_name order by column desc")or die(mysql_error());
When there is error in query it ends the control and shows the error message in same page..
i want to redirect to an error page when error occurs and display the error in that page.
here is my Code :
$conn = new mysqli($host, $user, $password, $database);
if ($conn->connect_error) {
header("Location: ".SITEURL."/error.php?message=" . url_encode($conn->connect_error));
}
Any Suggestion.