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 Quote 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* Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/178777-row-position/#findComment-945945 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.