I am attempting to count the rows returned from a \[code\]SELECT\[/code\] statement using PDO.\[code\]$stmt = $dbh->prepare("SELECT * FROM posts WHERE cat_id= ?");$stmt->bindParam(1,$cat_id);$stmt->execute();$rows = $stmt->fetchAll();$count_posts = count($rows);return $count_posts;\[/code\]I use \[code\]fetchAll()\[/code\] and then \[code\]count()\[/code\] to count but it doesn't work. When I echo this out it echos \[code\]0\[/code\]. I thought the array was \[code\]$rows\[/code\] and that \[code\]$count_posts\[/code\] would then be the count of that array?Thanks