Padgoi Posted February 20, 2008 Share Posted February 20, 2008 Right now, it's showing like this: How do I order it properly where it's in numerical order rather than ordering by 1's and then 2's and so on? The code I have right now is: $result = mysql_query("select * from Ratings order by profile"); Quote Link to comment Share on other sites More sharing options...
Orio Posted February 20, 2008 Share Posted February 20, 2008 Add a counter... <?php $result = mysql_query("select * from Ratings order by profile"); $i = 0; while ($row = mysql_fetch_array($result)) { echo $i." "; //and the row data //print everything $i++; } ?> Orio. Quote Link to comment Share on other sites More sharing options...
Padgoi Posted February 20, 2008 Author Share Posted February 20, 2008 Orio, all that does is display numbers... The users are entering a link like this: http://forums.facepunchstudios.com/member.php?u=1 Is there any way to make your code so that the $i represents the u= in the link? For instance, if the user puts: http://forums.facepunchstudios.com/member.php?u=787 and another users puts: http://forums.facepunchstudios.com/member.php?u=1212 The one with 787 should come before the one with 1212, but the way it is now, it won't and your code is just displaying how many rows are in the table. Please help? Quote Link to comment Share on other sites More sharing options...
PHP Monkeh Posted February 20, 2008 Share Posted February 20, 2008 What is actually stored in the `profile` field? Is it the entire URL or just their member id? Quote Link to comment 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.