ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:recordcount

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
v5:reference:connection:recordcount [2016/01/13 01:53]
mnewnham ↷ Links adapted because of a move operation
v5:reference:connection:recordcount [2018/05/03 14:39]
dregad [recordCount] method, not function
Line 6: Line 6:
    int recordCount()    int recordCount()
 </WRAP> </WRAP>
-The function ''recordCount()'' return the number of records returned by the last select statement, or -1 if the database driver does not support the operation. +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 [[reference:ADODB_COUNTRECS|$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.+If [[v5:reference:adodb_countrecs|$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 ===== ===== Usage =====
 <code php> <code php>
 /* /*
- IBM DB2 database connection assumed+ Existing database connection assumed
  */  */
 $result = $db->Execute('SELECT * FROM act'); $result = $db->Execute('SELECT * FROM act');
-$recordCount = $db->recordCount();+$recordCount = $result->recordCount();
 </code> </code>
  
v5/reference/connection/recordcount.txt · Last modified: 2018/05/03 14:39 by dregad