On Thu, 8 Jul 2004, Derick Rethans wrote:

> After some investigation I found that if I removed the "$ret = " before
> the query() call, then all queries are run just fine, and throw also a
> warning when I put back in the typoes.

I did some more investigations and it seems that as soon you try to
assign the result of sqlite_query() to a variable it always only execute
the first query in a multi-query query-string. Not only for CREATE as I
wrote before but it's also a problem for multiple INSERTs, or a mixed
INSERT/SELECT. In the code it's the difference between sqlite_compile
(sqlite.c:1472) (used when there is no assignment) and sqlite_exec
(sqlite.c:1559) when there is an assignment.

A slightly modified "expected" list:
>
> I would have expected something else though:
> 1. Without the "$ret = " it should throw a PHP warning for each broken
>    query. (That's current what it's doing).
> 2. With the "$ret = " it should NOT throw any warnings, and set the
>    $db->lastError() value accordingly whether there were errors
>    (with the last query) or not.

IMO this should be fixed ASAP, I can perhaps try to come up with a patch
myself too.

regards,
Derick

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to