in reply to Checking return results from an execute

With some databases, you can call rows() on the statement handle before fetching results. That doesn't work on all of them. Executing a 'SELECT COUNT(*)' is more reliable.

Replies are listed 'Best First'.
Re: Re: Checking return results from an execute
by ides (Deacon) on Jun 28, 2002 at 21:52 UTC
    I thought it was worth mentioning that I have found 'SELECT COUNT(1) FROM TABLE' to be faster on certain databases than 'SELECT COUNT(*) FROM TABLE'.

    -----------------------------------
    Frank Wiles <frank@wiles.org>
    http://frank.wiles.org