Hi guys, i'm having a little trouble with my script for combinig rows in my database and would be very appreciative if you could help.
i've only posted the query part of my script so you don't have read all the useless stuff as this is where i think i am going wrong.
What i am trying to achieve is for ym script to UPDATE the first set rows with the combined results of both sets of rows. 1 first set is for player 2 and the second set for player 66. but (shown in the pic below) theres a different row for each game_type on each server.
so for example i need it to take the kills and deaths from player '2' and player '66' on server '1' with the game_type 'Deathmatch', add them together, then UPDATE player 2's row with the combined values.
and the same in every case where the server value and game_type match.

<?
if ($ser1 == $ser2 && $gmty1 == $gmty2)
{$query1 = mysql_query("UPDATE chronos_stats SET
kills = kills + '".$row4["kills"]."' ,
deaths = deaths + '".$row4["deaths"]."' ,
WHERE player = '".$row1["id"]."' AND server = '".$row4["server"]."' AND game_type =$gmty2");}
else{$query2 = mysql_query("INSERT INTO chronos_stats VALUES
('".$row3["player"]."','".$row4["kills"]."',
'".$row4["deaths"]."','".$row4["server"]."','".$row4["game_type"]."')");
}
}
echo"<table><tr><th><span class=style9>-</span></th></tr>";
echo "<tr><th>PLayers merged successfully</th></tr>";
echo "<tr><th><span class=style9>-</span></th></tr></table>";
} else { ?>