Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 3694 invoked by uid 1010); 23 Oct 2003 16:02:23 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 3670 invoked from network); 23 Oct 2003 16:02:23 -0000 Received: from unknown (HELO web41406.mail.yahoo.com) (66.218.93.72) by pb1.pair.com with SMTP; 23 Oct 2003 16:02:23 -0000 Message-ID: <20031023160219.61701.qmail@web41406.mail.yahoo.com> Received: from [196.40.30.115] by web41406.mail.yahoo.com via HTTP; Thu, 23 Oct 2003 09:02:19 PDT Date: Thu, 23 Oct 2003 09:02:19 -0700 (PDT) To: 'PHP Development' MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: RE: [PHP-DEV] database driver: no more rows From: daggillies@yahoo.com (David Gillies) I use syntax like while(($dbrow=mysql_fetch_assoc($dbresult))!==false) in several hundred locations in a production ap. If PHP breaks my code then it won't get used. Simple as that. Anyway, unless I'm missing something, isn't the preferred PHP5 way to handle this via exceptions? Certainly the mysql driver is in error if it doesn't either a) reset the error after a successful call or b) distinguish between 'done' and 'failed' (like unix read() returning 0 is not an error, but -1 is). However a cleaner way of doing it for genuinely new code which would maintain BC would be for the driver writers to make it throw an exception, which would be disabled by default. Just a thought. Best Wishes David Gillies San Jose Costa Rica --- Lukas Smith wrote: > > From: Ilia Alshanetsky [mailto:ilia@prohost.org] > > Sent: Wednesday, October 22, 2003 7:18 PM > > To: Lukas Smith; 'PHP Development' > > Subject: Re: [PHP-DEV] database driver: no more > rows > > > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > I wouldn't mind such a change myself, however what > about all the > > installations > > where people do while (*fetch_row() !== false) ? > > Yeah ... php5 would be a good time to make this > change. > I don't assume that a lot of people will actually do > !== since in those > methods you either get an array or false .. > > Regards, > Lukas > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com