Jump to content

Last 10 users code


danx30

Recommended Posts

What I'm trying to do is have a section of my website to list the last 10 users of the page.  The users are saved into a mysql database.  There are thousands of users but only want it to show the last 10.

 

For some reason this is stumping me.  I'm just not sure how to approach it.  Any help would be appreciated.

Link to comment
Share on other sites

if its a case of the last 10 registered users, you could run a query and limit it to 10 for example

 

<?php
$qh = mysql_query("SELECT * FROM members_table WHERE active='1' LIMIT 0,10");
while($ret = mysql_fetch_array($qh)){
echo $ret['username'];
}
?>

 

Stuie

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.