Posted by Tyno Gendo on 04/16/07 10:18
roondog wrote:
> I have just started learning php and mysql. I am trying to make a news page
> for a site where you can enter news in a form and it appears on the news
> page. That is done, fairly simple. I've also ordered them with the latest
> first. I would now like to only show a certain number of the news articles.
> Say the latest five. Each article is numbered so I guess I would use that
> but i'm not really sure how to do it. Any ideas?
>
>
>
If you have a date field you can order by date descending, but ID is
fine if you happy with that... so...
SELECT * FROM news ORDER BY news_id DESC LIMIT 5
Navigation:
[Reply to this message]
|