|
From: Eric B. <eb...@ya...> - 2003-08-26 20:42:10
|
Markus,
The loop shown works if you don't have an error
handler. It won't work if you create your own error
handler and do an assert() on any errors.
It works like feof(), when reading from a file. The
loop continues as long as there is data to retrieve.
dbi_result_next_row() produces an error when the code
tries to access a row greater than or equal to the
number of rows.
For example, if a SELECT returned zero rows, then you
do a while(dbi_result_next_row()){}, you are trying to
access a row, zero, that is equal to the number of
rows, zero. An error will be triggered.
Therefore, you must either:
1) ignore this particular error
2) use a for() or while() based on the number of rows
I don't think it's a bug in libdbi. I now think, you
should probably keep it the way it is because it might
be an error someone is interested in finding.
It's just something libdbi developers will need to
keep in mind if creating their own error handler.
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|