Ok here\'s the trick. In the query I\'m getting the right results from a table named messages. (Its fetching the last 10 messages ordered by the time inserted in reversed or
Store your data & than use array_reverse,
while($row = mysql_fetch_assoc($result)){ $items[] = $row; } $items = array_reverse($items ,true); foreach($items as $item){ echo $item['time']." - ".$item['username']." - ".$item['message']; }