"Nick" <fr*****@fresh27.net> wrote in message
news:86**************************@posting.google.c om...
I wrote a news script to post news posts in reverse chronological
order.
I'd like a page to post the last 6 posts from a page, from newest to
oldest.
But as it is, I don't know how to find the number of the last row in
the table. So I have to count down from 100, skipping blank entries
along the way.
Is there a simple way to find what how many rows are in a mysql table?
Flip your table around by adding "ORDER BY date_added DESC" to make the last
entries come to the 'front' and adding "LIMIT 6" to your query which will
give you the first 6 entries.
"SELECT * FROM news_articles (WHERE <if any where statements are needed>)
ORDER BY date_added DESC LIMIT 6"
I think that is what your are trying to do.
William