I'm trying to count the number of entries in the 'classcode' column of my db which have 'class1' as the value and then convert this number into a PHP variable. Any ideas where I'm going wrong? Any help much appreciated
$result = mysql_query("SELECT COUNT(classcode) FROM playerinfo WHERE classcode='class1'");
$count = mysql_result($result, 0);
echo $count;
mysql_*functions are deprecated, they have been removed from PHP 7, your code will stop working when you upgrade to that version. You should not write new code using them, usemysqli_*or PDO instead.