Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4942 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14979 invoked by uid 1010); 23 Oct 2003 13:38:12 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14945 invoked from network); 23 Oct 2003 13:38:12 -0000 Received: from unknown (HELO mail.dybnet.de) (195.75.116.242) by pb1.pair.com with SMTP; 23 Oct 2003 13:38:12 -0000 Received: (qmail 21665 invoked by uid 508); 23 Oct 2003 13:38:27 -0000 Received: from unknown (HELO vandal) (vandal@212.202.39.121) by www.dybnet.de with RC4-MD5 encrypted SMTP; 23 Oct 2003 13:38:27 -0000 To: "'Cesare D'Amico'" , "'PHP Internals'" Date: Thu, 23 Oct 2003 15:37:03 +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: <200310231527.15424.cesare@ngi.it> Thread-Index: AcOZaPfTVe4+aYUwRku6ozyjVoq/VAAAK4tw Subject: RE: [PHP-DEV] database driver: no more rows From: smith@backendmedia.com ("Lukas Smith") Message-ID: References: <200310231527.15424.cesare@ngi.it> > From: Cesare D'Amico [mailto:cesare@ngi.it] > Sent: Thursday, October 23, 2003 3:27 PM >=20 > Alle 15:02, gioved=EC 23 ottobre 2003, Lukas Smith ha scritto: > > > . run query 1 > > > . check if q1 worked > > > . run query 2 > > > . check if q2 worked > > > . if q1 worked -> fetch data > > > > > > ...and so on. > > > > > > Perhaps I'm missing something, but I can't see a real issue here. > > > > Yeah, you are missing something :-/ >=20 > [...] >=20 > > 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. >=20 > Well, I didn't miss anything :) >=20 > What you call hacky is the way I usually work: do something, check if > there was an error; if so, collect the error, else (or then) go on. Well errors are not always fatal .. and if they are not then it should = be possible to proceed without any further "harm" to your script. For example in the sequence emulation in PEAR::DB you can optionally = created sequences on demand. This is done if the query to select the next value failed with an error specifying that sequence does not exist. We = currently just trap that error and if the user wants we create the sequence for = him and everything should proceed as usual. However this doesn=92t work if = we also check for errors during fetching (unless we know the end of the result = set .. which you obviously could do with a counter and a call to mysql_num_rows() unless of course you are doing an unuffered query). So anyways the current situation is very messy. A fix to atleast let us do = the error checking would be to have a mysql_clear_error() or something like that. Anyways nuff said about this issue. :-) Regards, Lukas