//I don't know about you. But for me this is what I had to do
$db = new SQLite3('databasename.db');
$result = $db->query("SELECT * FROM table_name");
$number_of_rows = 0;//for now
while($row = $result->fetchArray()) {
$number_of_rows += 1;
}
echo "Number of rows: $number_of_rows";