How can I return the number of counted rows with PDO?
This is my code:
$n=$dbh->prepare("SELECT count(*) FROM users_notifications WHERE userid=0 OR userid=:userid");
$n->bindParam(":userid",$userdata['id']);
$n->execute();
$notifications = count($n);
This returns just 1. Although there are 2 results when I run the query in the database: SELECT count(*) FROM users_notifications WHERE userid=0 OR userid=:userid