Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10973 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11621 invoked by uid 1010); 8 Jul 2004 08:57:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 11539 invoked from network); 8 Jul 2004 08:57:57 -0000 Received: from unknown (HELO jdi.jdimedia.nl) (212.204.192.51) by pb1.pair.com with SMTP; 8 Jul 2004 08:57:57 -0000 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i688vvH7025339 for ; Thu, 8 Jul 2004 10:57:57 +0200 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.11/8.12.11) with ESMTP id i688vqPb025334 for ; Thu, 8 Jul 2004 10:57:52 +0200 Date: Thu, 8 Jul 2004 10:57:52 +0200 (CEST) X-X-Sender: derick@localhost To: PHP Developers Mailing List Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at jdimedia.nl Subject: SQLite weirdness From: derick@php.net (Derick Rethans) Consider this piece of code: query($create_query); if ($db->lastError() != SQLITE_OK) { echo $db->lastError(); } ?> As you can see there are two typoes (REATE instead of CREATE) so obviously I expected to get a result value other than SQLITE_OK back, but that didn't happen, and no php warnings either. Then I fixed those two typoes, ran the script and to my surprise it only showed the *first* table in the database. Making a typo in the first create table statement did throw a warning (unexpected when $ret = is used) and the return value was set to SQLITE_ERROR. 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 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 or not. In the code I do see that there is a check for if the return value is used, so this behavior is possible and definitely wanted IMO. The current behavior is just wrong and uninituitive. regards, Derick