Displaying recently joined members
Posted: Mon Dec 05, 2011 9:20 am
I want to display a list of 5 recently joined members on a page.
I wrote this code, however it does not display the most recent members. Rather it displays 5 members sorted alphabetically.
The table 'pmember ' stores name and location amongst other details. It does not store the join time of members.
Is there a way i could display the latest members ?
Thanks a lot !
I wrote this code, however it does not display the most recent members. Rather it displays 5 members sorted alphabetically.
The table 'pmember ' stores name and location amongst other details. It does not store the join time of members.
Is there a way i could display the latest members ?
Code: Select all
<?php
require_once ('connect.php');
$list=mysql_query("SELECT * FROM pmember LIMIT 5");
while($row = mysql_fetch_array($list))
{
$recentname = $row['rname'];
$recentlocation=$row['rlocation'];
echo"<li>$recentname from $recentlocation</li>" ;
}
?>