Q . How to handle MySQL error with PHP ?

Brad Johnson. asked, Feb 18 ' 2015

Please Suggest.

  • MySQL
  • error-handling

1 Answers

You can try this.

<?php

function mysqlCustomError($location) { 
     header('Location: ' . $location);
     exit(); 
} 

mysql_query($sql) or mysqlCustomError("/error.php");

?>

 

Leave a Ansewer