I am using count function to get the number of rows buffered in a resultset.
But it always returns count as one even if resultset is empty.
Please see the co
As per your comment if you just want to return the count of records you could wrap your query in a SELECT COUNT(*)
and change $dbhandle->query
to $dbhandle->querySingle
. This will work with or without LIMIT
.
$dbhandle = new SQLite3("sqlitedb_111.db");
$selQuery1 = "SELECT COUNT(*) FROM (SELECT id,dbname,tabname,fieldname FROM scan_results ORDER BY id ASC LIMIT 0,10)";
$resQuery1 = $dbhandle->querySingle($selQuery1);
print count($resQuery1);