Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:9835 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37402 invoked by uid 1010); 13 May 2004 13:46:07 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 37302 invoked from network); 13 May 2004 13:46:05 -0000 Received: from unknown (HELO asuka.nerv) (24.100.195.79) by pb1.pair.com with SMTP; 13 May 2004 13:46:05 -0000 Received: (qmail 27267 invoked from network); 13 May 2004 13:46:03 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 13 May 2004 13:46:03 -0000 Reply-To: ilia@prohost.org To: internals@lists.php.net Date: Thu, 13 May 2004 09:46:05 -0400 User-Agent: KMail/1.6.1 References: In-Reply-To: Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <200405130946.05943.ilia@prohost.org> Subject: Re: [PHP-DEV] SQLite API deficiency From: ilia@prohost.org (Ilia Alshanetsky) On May 13, 2004 09:25 am, Stanislav Malyshev wrote: > I have discovered that SQLite function sqlite_query runs sqlite_exec > function if it's return value is used and sqlite_compile/sqlite_step combo > if return value is used. I think this is a problem - if I want to run some > pack of queries (like, create whole DB schema in one call), I can do it > with sqlite_query - but only if I don't check the return value - and thus > don't know if it succeeded or not! If I check the return value, it runs > sqlite_compile/sqlite_step, which can not run multiple SQL statements. You could always check the status of the query by running the sqlite_last_error(). > I think this should be fixed. In order not to break BC, I propose to add > new function to SQLite API - sqlite_exec, which - surprise! - would always > call sqlite_exec and would return only true/false. Good idea. > Though, the even better > solution would be to kill that return_value_used check altogether and use > two separate functions always, depending on the task. I'd prefer to have sqlite_exec() like you propose and leave sqlite_query() as is. Ilia