stelthius Posted December 18, 2008 Share Posted December 18, 2008 Hello guys, I have made a little code to display the last user registered now i want to alter it to show the last 5 users registerd but it seems no matter how i try and do this it doesnt want to work, my snippet is below.. <?php include('include/session.php'); $new = mysql_fetch_array(mysql_query("SELECT * FROM `users` ORDER BY `signupdate` DESC LIMIT 0, 1")); /* Gets the newest member */ echo "New Users : " . $new[username]; /* Displays newest member */ ?> Thanks Rick. Link to comment https://forums.phpfreaks.com/topic/137527-solved-display-last-5-users-registerd/ Share on other sites More sharing options...
premiso Posted December 18, 2008 Share Posted December 18, 2008 <?php include('include/session.php'); $res = mysql_query("SELECT * FROM `users` ORDER BY `signupdate` LIMIT 5"); /* Gets the newest member */ while ($row = mysql_fetch_assoc($res)) { echo "New User : " . $row['username'] . "<br />"; /* Displays newest member */ } ?> Should get you what you want. Link to comment https://forums.phpfreaks.com/topic/137527-solved-display-last-5-users-registerd/#findComment-718681 Share on other sites More sharing options...
stelthius Posted December 18, 2008 Author Share Posted December 18, 2008 Thank you, nice and simple one for a change lol, Thanks again Regards Rick Link to comment https://forums.phpfreaks.com/topic/137527-solved-display-last-5-users-registerd/#findComment-718687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.