I have a simple counting algorithm in PHP using PDO and MySQL. The problem is that the code doesn’t count past 9.
I have table with 99 records inside. Here is the code:
<p>Number of Excused Absences: <b style="color: #000000;"> <?php $stmt = $pdo->prepare("SELECT COUNT(member_id) FROM absence WHERE absent = 1;"); $stmt->execute(); $result = implode($stmt->fetch()); $absent = $result; echo $absent; ?> </b></p>
When I run the query in phpMyAdmin, it comes out to 99. But in the site itself, it only shows 9. What did I do wrong?