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 <[EMAIL PROTECTED]> wrote:
> > From: Ilia Alshanetsky [mailto:[EMAIL PROTECTED]
> > 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

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to