Gebruik fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Zou moeten zijn
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows
Gebruik fetchColumn()
$count = $db->query("SELECT COUNT(id) FROM users");
Zou moeten zijn
$count = $db->query("SELECT COUNT(id) FROM users")->fetchColumn();
echo $count; //Returns number of rows