Jump to content

[SOLVED] Getting top 10?


Chevy

Recommended Posts

I am trying to get the top 10 rows out of a table in MySQL.

 

The thing is I want the top 10 rows of usernames...

 

  $stuff = mysql_query("SELECT MAX(`username`) AS `username` FROM `stuff` LIMIT 10");

     while ($top = mysql_fetch_array($stuff)){

          echo '<hr>'.$top['username'].'<hr>';

      }

 

So if there were 4 rows with the same username i would be above the one with  rows of one username.

 

Make sense?

Link to comment
https://forums.phpfreaks.com/topic/83993-solved-getting-top-10/
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.