I'm currently making a game to teach myself PHP as I go. I've already progressed quite a bit but I'm stuck now at the statistics where I want to show how many of each player-class there currently is in the game.
Thanks everyone, finally managed to fix it - not in the way as answered but the answer did help me getting to a result!
Which is:
<?php
echo '<b>Current Classes in the Game :</b>' . '<br />';
$result = $db->query("SELECT COUNT(*) FROM users WHERE role='Warrior'");
$row = $result->fetch_row();
echo $row[0] . ' Warriors' . '<br />';
$result = $db->query("SELECT COUNT(*) FROM users WHERE role='Mage'");
$row = $result->fetch_row();
echo $row[0] . ' Mages' . '<br />';
$result = $db->query("SELECT COUNT(*) FROM users WHERE role='Priest'");
$row = $result->fetch_row();
echo $row[0] . ' Priests' . '<br />';
$result = $db->query("SELECT COUNT(*) FROM users WHERE role='Rogue'");
$row = $result->fetch_row();
echo $row[0] . ' Rogues' . '<br />';
?>