PHP4 MSSQL Error handling
| From: | Salve Tinkerworth | Date: | Wed, 24 Jul 2002 23:48:52 +0000 |
| Subject: | PHP4 MSSQL Error handling | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-20760@lists.php.net to get a copy of this message | ||
Does anyone have any good tips for error handling? I've tried different
methods to retrieve good error information from mssql_query but nothing
seems to be working.
Here's the latest attempt:
$result=mssql_query($sql2);
$result=mssql_query('SELECT @@ERROR As ErrorCode');
$error=mssql_fetch_row($result);
if($error['ErrorCode'] != 0) {
echo $error['ErrorCode'];
echo $sql2;
die('Inserting OPS failed');
}