# database driver: no more rows

- Thread: https://externals.io/message/4946
- Original archive: https://news-web.php.net/php.internals/4946
- Started by David Gillies on 2003-10-23T16:02:19+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #4946 — David Gillies — 2003-10-23T16:02:19+00:00

URL: https://externals.io/message/4946#4946

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 <smith@backendmedia.com> wrote:
> > […]
> rows
> > […]
> about all the
> > […]
> 
> 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
> 
> -- 
> 
> 
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
