Jump to content

How to list new profiles first?


dcibrando

Recommended Posts

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

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.