Du bør bruge fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Bør være
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows
Du bør bruge fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Bør være
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows