I have a query Score that finds the score for a specific person in each record. In addition to each individual score, I need the total sum of all the scores.
for ($i=0; $i<mysql_num_rows($queryCash); $i++)
{
$PlayerTotalScore += mysql_result($queryCash, $i, Score);
}
...
echo $PlayerTotalScore;
...
while ($rsCash = mysql_fetch_array($queryCash, MYSQL_ASSOC))
{
...
}
Doesn't work because (I assume) it's already reached the last record.
So I have two questions. Is there away to do what I'm doing above that doesn't leave the result at the last record?
Or is it less sever load to do two seperate queries (one to selecte the sum of the scores and one for each individual record)?