It is necessary to count the number of posts. Used

mysql_result(mysql_query("SELECT COUNT(*) ... 

How to do this in PDO in the best way?

    1 answer 1

     $STH = $DBH->query('SELECT * from tables'); if ($row = $STH->fetch()) { $STH->rowCount(); } 

    Works depending on the version of MySQL