How are columns in MySQL?

There is a table
5b51b4bea1130798709415.jpeg
It is desired columns
5b51b3f0a24d5955103478.jpeg
There is also a code
<? mysql_query("SET NAMES 'utf8'",$bd_connect);
 $result_table = "SELECT DISTINCT `games` FROM `dlepisode1` WHERE `approved` IS NULL ORDER BY `refsumma` DESC" or die(mysql_error());
 $rs = mysql_query($result_table, $bd_connect);

 $result_table_1 = "SELECT `refsumma`, `nickname`, `payeer` FROM `dlepisode1` WHERE `approved` IS NULL ORDER BY `refsumma` DESC" or die(mysql_error());
 $rs_1 = mysql_query($result_table_1, $bd_connect);
 while($myrow = mysql_fetch_array($rs) AND $myrow_1 = mysql_fetch_array($rs_1))
 {echo "<tr style='display: flex; margin-top: 5px;'-->".$myrow['games']."
 ".$myrow_1['nickname']."".$myrow_1['refsumma']."".$myrow_1['payeer']."";}?>

and output the result
5b51b5059907e595166034.jpeg
The problem is: you need to associate columns between `games` and `refsumma` so what would a game table (`games` )output the sum of the values in column `refsumma` which belong to this or that game

for example, the game CastleOwner = 526.05 / game Farm Crypto = 381.85 / game Gangster World = 392.49 here about something like this
June 3rd 19 at 19:33
1 answer
June 3rd 19 at 19:35
Can show example? - letitia_Tillman commented on June 3rd 19 at 19:38

Find more questions by tags MySQL