Dovresti usare fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Dovrebbe essere
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows
Dovresti usare fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Dovrebbe essere
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows