I’m using a basic SQL query with ADO and PHP but the row count always returns -1. What am I missing?
Here is my code:
include 'constants.php';
// Create an instance of the ADO connection object
$conn = new COM ("ADODB.Connection")
or die("Cannot start ADO");
// Open the connection to the database
$conn->open(DB_CONN_STR);
$query = "select * from table_name";
$rs = $conn->execute($query);
if (!$rs) {
return;
}
else {
return $rs->RecordCount();
}
I know this table has values…what am I missing?
The manual says why.
http://phplens.com/lens/adodb/docs-adodb.htm#recordcount
seems you have set