Re: sqlite and sqlite_last_error()
| From: | Wez Furlong | Date: | Wed, 08 Oct 2003 18:29:24 +0000 |
| Subject: | Re: sqlite and sqlite_last_error() | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-108@lists.php.net to get a copy of this message | ||
Its a limitation of libsqlite; its error codes are not as rich as its error
messages.
I've already explained this to Pierre and Lukas, and that if anything
needs to be fixed, it is libsqlite itself.
Yes, it's annoying :-)
--Wez.
----- Original Message -----
From: "Mika Tuupola" <tuupola@appelsiini.net>
To: <pecl-dev@lists.php.net>
Sent: Wednesday, October 08, 2003 7:03 PM
Subject: [PECL-DEV] sqlite and sqlite_last_error()
>
> Is it intentional that sqlite_last_error() always returns
> 1, even though correct error is captured in $php_errormsg
> if tracking errors? For example:
>
> -cut-
> ini_set('track_errors', true);
>
> $conn = sqlite_open('./test.db');
> $result = sqlite_query('SELECT * FROM nosuch', $conn);
>
> print '$php_errormsg = ' . "$php_errormsg \n";
> print 'sqlite_last_error($conn) = ' . sqlite_last_error($conn) . "\n";
> print 'sqlite_error_string(sqlite_last_error($conn)) = ' .
> sqlite_error_string(s
> qlite_last_error($conn)) . "\n";
> -cut-
>
> outputs:
>
> -cut-
> $php_errormsg = no such table: nosuch
> sqlite_last_error($conn) = 1
> sqlite_error_string(sqlite_last_error($conn)) = SQL logic error or missing
> database
> -cut-
>
> I found this behaviour when writing errorhandling for DB sqlite
> driver.