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
https://forums.phpfreaks.com/topic/180320-last-10-users-code/
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
https://forums.phpfreaks.com/topic/180320-last-10-users-code/#findComment-951220
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.