There are many conflicting statements around. What is the best way to get the row count using PDO in PHP? Before using PDO, I just simply used mysql_num_rows.>
mysql_num_rows
function count_x($connect) { $query = " SELECT * FROM tbl WHERE id = '0' "; $statement = $connect->prepare($query); $statement->execute(); $total_rows = $statement->rowCount(); return $total_rows; }