on Tue, 01 Oct 2002 10:50:26 GMT, [EMAIL PROTECTED]
(Gary Stainburn) wrote: 

> Nobody's mentioned:
> 
> $countrow=$sth->rows;
> 
> This way is more efficient that doing the 'select count(*)' as
> it's done from the same select query, and it also means that yo
> know beforehand how many rows you will be reading, which is often
> usefull, and is not possible if you use the countrow++ method.

Unfortunately, my DBI documentation mentions:

    For `SELECT' statements, it is generally not possible
    to know how many rows will be returned except by
    fetching them all.  Some drivers will return the
    number of rows the application has fetched so far, but
    others may return -1 until all rows have been fetched.
    So use of the `rows' method or `$DBI::rows' with
    `SELECT' statements is not recommended.

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to