Error handling
Moderator: General Moderators
Error handling
I have a question on how to handle errors. I have a function that performs an INSERT sql statement. The statement will give an error if one of the values inserted is not unique. How can I catch that error and then print out a meaningful message to the user. Since it is a Oracle error rather than a PHP error, does OCI have any functions that will help?
Thanks, now I know how to check for an error. But how do I stop it from automatically outputting an error message. i want to check for an Error which I am doing with OCIError, then if there is an error I'll do a case statement to tell the user what the error is. But the webserver is still outputting this
I know what the error code means and why it is doing it. I just need to know how to make it not print out the error for me
Code: Select all
Warning: OCIStmtExecute: ORA-00001: unique constraint (REPORT.PK_SKU) violated in D:\Apache\Apache2\htdocs\toppc\confirm.php on line 43