Please put the appropriate code tags around any code you post. It makes it so much easier to read.
What are all those \n and concatenations? You can format a query on multiple lines like this (makes it easier to read):
$sql = "SELECT\n"
. " player_name\n"
. " , r1\n"
. " , r2\n"
. " , r3\n"
. " , r4\n"
. " , r1+r2+r3+r4 AS total\n"
. "FROM scores LIMIT 0, 30 ";
But anyway, in your code you never execute that query. Instead, you execute this one:
$sql = "
, r1+r2+r3+r4 AS total
LIMIT 0, 30
So right now, there is no total to display at all.
$query_Recordset1 = "SELECT player_name, r1, r2, r3, r4 FROM scores";
Unless you calculate it in PHP.