Minase Posted October 23, 2009 Share Posted October 23, 2009 hello i need something like this SELECT * FROM USERS ORDER BY GOLD DESC it will return something like this ID GOLD 3 555 1 400 2 100 how can i return the row place for ID 2 which have 100 gold ID 3 = place 1 ID 1 = place 2 how can i do that? thank you Link to comment https://forums.phpfreaks.com/topic/178777-row-position/ Share on other sites More sharing options...
Minase Posted October 27, 2009 Author Share Posted October 27, 2009 *bump* Link to comment https://forums.phpfreaks.com/topic/178777-row-position/#findComment-945827 Share on other sites More sharing options...
xtopolis Posted October 28, 2009 Share Posted October 28, 2009 Create a counter in PHP when you retrieve and iterate through the results. I am not sure if there is a way to do what you're asking, but that's something you could google. $result = mysql_query($sql); $i = 0; while( $row = mysql_fetch_array($result) ) { echo 'Position: ' . $i; echo $row; $i++; }//while Link to comment https://forums.phpfreaks.com/topic/178777-row-position/#findComment-945945 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.