On my front page I would like my most recent Blog post or message to be displayed.
My current query however displays the messages in order of row number so the oldest or first blog message is displayed and the newest is at the bottom of the page.
I would like it so the most recent 5 blogs are displayed.
In my table “blog” I have columns:
-blog_id
-title
-author
-date (y-m-d)
-content
This is my query
SELECT * FROM blog LIMIT 5
I tried using SELECT MAX but it only returns one row.
How can I get the last 5 rows etc.
I would like to order it by row_id (blog_id) as some posts may have the same date.
Thanks
http://dev.mysql.com/doc/refman/5.5/en/sorting-rows.html