PDA

View Full Version : Finding the five latest posts in a MySQL database?


FethrdWlf
06-20-2011, 01:00 AM
I've been making a website where people can place comments, and then view them on every page. On the page where they made the comment, it's the main part of screen. On the other pages, the comments are just displayed in the sidebar. But, I'm hoping that A LOT of comments are made. On the pages where they are in the sidebar, I just want to show the five latest posts. That way the pages aren't insanely long because of the comments. http://web3.x10.mx Please check it out, and tell me what you can think of... I have setup some fake comments just to show you how they are ordered, and etc. I only have the comments being displayed on the "What You Think" page and the "Home" page (in the sidebar).

edbr
06-20-2011, 01:40 AM
order by date and limit 5

FethrdWlf
06-20-2011, 01:51 AM
order by date and limit 5

Thank you! I can Google how to limit a query from here.