Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4940 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66304 invoked by uid 1010); 23 Oct 2003 13:03:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 66173 invoked from network); 23 Oct 2003 13:03:53 -0000 Received: from unknown (HELO mail.dybnet.de) (195.75.116.242) by pb1.pair.com with SMTP; 23 Oct 2003 13:03:53 -0000 Received: (qmail 20809 invoked by uid 508); 23 Oct 2003 13:04:08 -0000 Received: from unknown (HELO vandal) (vandal@212.202.39.121) by www.dybnet.de with RC4-MD5 encrypted SMTP; 23 Oct 2003 13:04:08 -0000 To: "'Cesare D'Amico'" , "'PHP Internals'" Date: Thu, 23 Oct 2003 15:02:44 +0200 Organization: BackendMedia GbR MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 In-Reply-To: <200310231458.43857.cesare@ngi.it> Thread-Index: AcOZZPyWrN6dUDb0SMaYYXrwl5q/eQAAC6oQ Subject: RE: [PHP-DEV] database driver: no more rows From: smith@backendmedia.com ("Lukas Smith") Message-ID: References: <200310231458.43857.cesare@ngi.it> > From: Cesare D'Amico [mailto:cesare@ngi.it] > Sent: Thursday, October 23, 2003 2:59 PM > Alle 00:18, gioved=EC 23 ottobre 2003, Lukas Smith ha scritto: > > run query that works > > run query that doesn't > > > > now when you fetch the rows of the first query you will usually > > determine if you hit the end if the result set by checking if you > > don't get an array returned > > > > if you don't get an array you check for an error and in several ext > > you will get the error created by the second query. This is also > > caused by the fact that the error checking simply returns the last > > error which cant be cleared appearently. >=20 > But can't you resolve this problem by checking if the query worked = just > after issuing it? I mean, do something like: >=20 > . run query 1 > . check if q1 worked > . run query 2 > . check if q2 worked > . if q1 worked -> fetch data >=20 > ...and so on. >=20 > Perhaps I'm missing something, but I can't see a real issue here. Yeah, you are missing something :-/ mysql_error() will return you the last error over and over again. So you find that q2 didn=92t work and you want to proceed then you will = from then on always get that failure from q2 until you produce a new error. = This is not the case in all ext but iirc atleast in mssql and sybase the = problem also seems to exist. While I think about it: There would be one solution that wouldn=92t = break BC: adding a function that would clear the last error. Then you could = manually clear an error after you have read it. The other alternative would be to remember the last error and check if = that error is the same every time you check and all such solutions are = possible but very hacky of course. Regards, Lukas