Jump to content

Update Table with count


Jay2391

Recommended Posts

I am trying to give numbers to these field but they only give the last number ...

 

I have 4 recorsd so I only get the 4 all the other records stay at Zero

 

why is that when i echo I can see the 1 2 3 and 4

 

$query_rr1 = "SELECT * FROM $tabler WHERE (tourney_name=\"$tourney_name\") ORDER BY 'ran_rank' ";
$result_rr1 = mysql_query($query_rr1, $tc); 		            
while($row_rr1 = mysql_fetch_array($result_rr1)){
	$player_id1 = $row_rr1['result_id'];	
	$rank_c ++;

	echo"<br>$player_id1";
	echo"<br>$rank_c";

                $change_rr1 = "UPDATE $tabler SET rank='$rank_c' WHERE (result_id=\"$player_id\")";  
                mysql_query($change_rr1) or die ("Cannot Update Table". mysql_error());
           }

Link to comment
https://forums.phpfreaks.com/topic/37059-update-table-with-count/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.