Anda harus menggunakan fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Seharusnya
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows
Anda harus menggunakan fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Seharusnya
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows