Reputation: 29
$result = $db->("SELECT `count` FROM playerCount");
while($row = mysql_fetch_assoc($result)) {
echo $row['count'];
}
How can I convert line: while($row = mysql_fetch_assoc($result)) {
to PDO?
Thanks.
Upvotes: 1
Views: 2814
Reputation: 562731
$stmt = $db->query(...);
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
Upvotes: 4