Re: PHP4 MSSQL Error handling
| From: | Adam Voigt | Date: | Thu, 25 Jul 2002 12:42:55 +0000 |
| Subject: | Re: PHP4 MSSQL Error handling | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20782@lists.php.net to get a copy of this message | ||
$result = mssql_query($query) or die(mssql_get_last_message());
Adam Voigt
adam.voigt@cryptocomm.com
On Wed, 2002-07-24 at 19:48, Salve Tinkerworth wrote:
> 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');
> }
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>