help

Discussion in 'PHP' started by MTA, Feb 11, 2009.

  1. #1
    I am making a script for my site.. a friends activity
    if the update there profile it will show demo updated profile..

    I am lost on this.. I can pull the info out of the database just fine i want it to be where it will only be there for 1 day.. on the page that I want.. then after that day it will not show on that page.. but still be in the database
    date is time() in the database
    $a = mysql_query("SELECT * FROM mood  ORDER BY date DESC LIMIT 0,1");
    while ($f = mysql_fetch_array($a))
    
    		{
    
    
    
    $mood_image['moodimage'] = uimage($f['userid'],"60",4,"");
    echo '<li>'.$mood_image['moodimage'].'<img src=\'http://mateable.com/member/mood/css/images/bullet.gif\' alt=\'-\' />'.$f['status'].'</li>';
    
    echo '<li><strong>Mood:</strong>'.$f['mood'].'</li>';
    
    }
    Code (markup):
     
    MTA, Feb 11, 2009 IP
  2. imphpguru

    imphpguru Active Member

    Messages:
    439
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    #2
    Hi,
    This happens because you are limiting it to only 1. So it will only fetch the top row. instead, you can say LIMIT 0,30, and it will fetch 30 images.

    Thanks

    imphp
     
    imphpguru, Feb 11, 2009 IP