dcibrando Posted March 14, 2008 Share Posted March 14, 2008 I am wanting to list to last 3 registered users on my Alumni website. How do I do this? Right now it's just showing the first 3 that registered...not the most recent 3. Thanks! function new_members() { $q1 = "select * from classmates_members where profile_image = '' order by MemberID limit 0,3 "; $r1 = mysql_query($q1) or die(mysql_error()); $n = mysql_num_rows($r1); $rows = "<table width=\"320\" cellspacing=0 cellpadding=0 align=center>\n<tr>\n\t<td height=20> </td>\n</tr>\n\n"; if($n > '0') { while($a1 = mysql_fetch_array($r1)) { $sizes = getimagesize("profile_images/$a1[profile_image]"); //define the type - lendscape or portrait if($sizes[0] > $sizes[1]) //landscape (97 x 64) { if($sizes[1] > 97) { $show_size = "whidth=97"; } else { $show_size = "width=$sizes[0]"; } } else //portrait { if($sizes[1] > 64) { $show_size = "height=64"; } else { $show_size = "height=$sizes[1]"; } } Link to comment https://forums.phpfreaks.com/topic/96133-how-to-list-new-profiles-first/ Share on other sites More sharing options...
lordfrikk Posted March 14, 2008 Share Posted March 14, 2008 <?php $q1 = "select * from classmates_members where profile_image = '' order by MemberID desc limit 0,3 "; ?> Link to comment https://forums.phpfreaks.com/topic/96133-how-to-list-new-profiles-first/#findComment-492127 Share on other sites More sharing options...
samshel Posted March 14, 2008 Share Posted March 14, 2008 Hi, Assuming MemberID is autoincrement field, try this $q1 = "select * from classmates_members where profile_image = '' order by MemberID desc limit 0,3 "; OR if you have a date_joined field in the table sort by that field in descending order. hth Link to comment https://forums.phpfreaks.com/topic/96133-how-to-list-new-profiles-first/#findComment-492128 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.