Jump to content
php.lv forumi

Veidojot top 10


m8t

Recommended Posts

Tātad, Es vēlos savai lapai izveidot top 10 postotājus. Man ir tabula ar lietoāja datiem un postiem. Pašlaik esmu nonācis līdz šim:

 

include("connection.php");
$query = "SELECT * FROM {$tblprefix}users GROUP BY posts ORDER BY posts ASC LIMIT 10"; 
$run = mysql_query($query)
or die("Error running query: " . mysql_error());
while($row = mysql_fetch_array($run)) {

echo "<li>[b]...[/b] vieta - <a href=\"user.php?id={$row['id']}\" title=\"{$row['username']}\">{$row['username']}</a></li>";  

}

 

Kāl ia es izveidoju, lai man lietotāji sadalītos par 1,2, 3... vietu, līdz pat 10? Saprotu kā izvilkt 10 lielākos postotājus, bet nesaprotu, kā viņiem pilikt klāt vietas nr.

 

Ceru ka palīdzēsit

-Shizo0

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...