Disable "die" message
Posted: Tue Jan 15, 2008 10:39 am
Hi everybody,
I have a pretty dumb question for you guys about how to disable the "die" message if a query fails.
I am using PHP5 with an MS-SQL Database.
example:
If a query fails, I want to show only something like:
"TRANSACTION MUST BE UNIQUE"
rather than
"Warning: mssql_query() [function.mssql-query]: message: Violation of UNIQUE KEY constraint 'myNewContraint'. Cannot insert duplicate key in object 'myTransactions'. (severity 14) in C:\myPage.php on line 111
Warning: mssql_query() [function.mssql-query]: Query failed in C:\myPage.php on line 111"
I am using this code:
But it shows both messages.
Thank you for your help.
I have a pretty dumb question for you guys about how to disable the "die" message if a query fails.
I am using PHP5 with an MS-SQL Database.
example:
If a query fails, I want to show only something like:
"TRANSACTION MUST BE UNIQUE"
rather than
"Warning: mssql_query() [function.mssql-query]: message: Violation of UNIQUE KEY constraint 'myNewContraint'. Cannot insert duplicate key in object 'myTransactions'. (severity 14) in C:\myPage.php on line 111
Warning: mssql_query() [function.mssql-query]: Query failed in C:\myPage.php on line 111"
I am using this code:
Code: Select all
$rs4 = mssql_query($query4) or die('TRANSACTION MUST BE UNIQUE');
Thank you for your help.