Hello, I am new to coding and am trying to have this query give the top 5 networth members goldcoins and a news telling them they won. It runs without error but is only giving the goldcoins and news to the top networth member.

Code:
	         $sql="SELECT nickname, email, rank, uid, SUM(bank+cash) AS nw FROM user_characters WHERE rank!='Admin' and rank!='Forum Mod' and nickname!='Guest' and rank!='Public Relations' GROUP BY nickname ORDER BY nw DESC LIMIT 0,5;";
                 $sql=mysql_query($sql);
                  if(@mysql_num_rows($sql)==0) {}
                 else {
                 while($temp=mysql_fetch_array($sql)) 
		{
                $sql = "UPDATE users_goldcoins SET goldcoins=goldcoins+200 WHERE uid=".$temp[uid]."";
		$sql = mysql_query($sql) or die(mysql_error());
		$sql	= "INSERT INTO `news` (`to` , `news` , `timestamp`) VALUES ('".$temp['email']."', '<br>Congratulations. You Have Won 200 B.D(s) For Finishing Within The Top 5 Networth. ', '$time')";
		$sql = mysql_query($sql) or die(mysql_error());
                 }}