Jump to content

Table sort, only display latest


yoshida

Recommended Posts

EDIT: FIXED!$query="SELECT * FROM news ORDER BY date DESC LIMIT 1";How do I query a database to only echo the latest entry from a certain table? I know how to display data and order it by a certain field, but I only want to display the latest adition (the one with the newest date).Date is formatted as yyyymmdd so that's what it's sorted by.Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...