Jump to content

Ranking Ranks Greatest Action as Last Rank


McBryver

Recommended Posts

Hello everyone...

 

My following code is supposed to order rank by from Greatest covertaction but for some reason it is ranking the greatest last eg.

900,000 Rank 1

900,001 Rank 2

900,002 Rank 3

 

Here is the code:

 

<?php
$q = "SELECT * FROM `accountinfo_db` ORDER BY `covertaction`, `anticovertaction` ASC";
$res = mysql_query($q) or die(mysql_error());
$i = 1;
while($player=mysql_fetch_array($res)){
	$id = securevar($player['id']);
	$time = time();
	$user = securevar($player['username']);
	$q = "UPDATE `accountinfo_db` SET `covertrank` = '$i', `lastTurnTime` = '$time' WHERE `id` = '$id'";
	if(mysql_query($q)){
		echo "Covert & Anti Covert Rank set to $user as ".number_format($i)."!<br />";
	} else {
		// query failed with an error
		// put your error reporting/logging code here...	
	}
	$i++;
}
?>

 

Any help will be appreciated!

Brian

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.