I've got a small website made with php and using MySQL for storing information. In the database I've made some relationships between some of the tables.
However, when I try to for instance 'delete from user where userid=2' and userid 2 is used elsewhere, I'm unable to catch the error and give a meaningful error message to the user. What I get is:
ERROR: unable to execute query 'delete from User where UserId='2'' and the php-script is halted.
I've tried going through php.ini, setting error_reporting(0) and
$result = SQLQuery($query);
return "User deleted successfully";
return "Some error message";
I could of course check that the userid is not in use before I try to delete but that defeats some of the purpose of the foreign key contraint.