ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:recordcount

recordCount

See Also

Feature Comparison Matrix

Syntax
 int recordCount()

The recordCount() method returns the number of records retrieved by the last select statement, or -1 if the database driver does not support the operation.

If $ADODB_COUNTRECS is set to true before a query is executed, then the number of records will be retrieved, even if the function has to be emulated by issuing a COUNT * on the query. This can result in slow responses.


Usage

/*
 * Existing database connection assumed
 */
$result = $db->Execute('SELECT * FROM act');
$recordCount = $result->recordCount();
v5/reference/connection/recordcount.txt · Last modified: 2018/05/03 14:39 by dregad