".(time()-30*24*60*60)." ORDER BY date DESC"; $result = mysql_query($sql); $array = array(); while($row = mysql_fetch_assoc($result)) $array[] = $row; $ids = array(); for($i = 0; count($ids) < 4; $i++) { $entry = $array[rand(0, count($array)-1)]; if(!array_key_exists($entry['date'], $ids)) $ids[$entry['date']] = $entry; } foreach($ids as $value) { echo ""; } ?>