Is it possible or another solution to sum and select multiple rows in single sql query and print with while looping like that:
$query = mysql_query("SELECT SUM(Total), * FROM table");
while ($fetch = mysql_fetch_row($query)) {
echo $fetch[a];
echo $fetch[b];
echo $fetch[c];
}