- Joined
- Jul 26, 2011
- Messages
- 139
- Reaction score
- 15
Hi again. I'm still working on my topstory and news items and I've got everything as I wanted. Except the ordering. I have ordered the news-items after date, but as you can see on the picture below, the article from yesterday shows first, I want the newest one to be shown first.
The code for news-items:
The code for news-items:
PHP:
<?php
$latest = mysql_query("SELECT * FROM site_news WHERE id!='$not_id' ORDER BY date LIMIT 1, 2");
while($row = mysql_fetch_array($latest))
{
$title = $row['title'];
$short_text = $row['short_text'];
$article_id = $row['id'];
$article_image = $row['image'];
$date = $row['date'];
echo "<a class='news-item' href='article.php?id=$article_id'>
<div style='float:left;margin-top:5px;margin-left:10px;'>
<span class='title'><strong>$title</strong></span> »<br />
<span style='color:#8C8C8C'>$date</span>
</div>
</a>";
}
?>

