Get maximum ID from a table
Posted on August 30, 2008, Filled under PHP,
Bookmark it
Thanks for visiting our website! We regularly publish posts like this one. If you are interested in receiving the latest updates as soon as they are posted, please consider subscribing to the RSS feed or to our e-mail newsletter.
To get the maximum id from a table you can use the MAX() function.
Here’s an example:
SELECT MAX(id_field_here) as max_id FROM `table`;
Do you wish to receive the latest updates as soon as they are posted? Get our RSS Feed or Subscribe to the Newsletter!
- August 30, 2008
- article by Gabriel C.
- 1 comment
Sponsors
Related Posts
-
Create, Customize and Send Newsletters: MeeNewsat August 3, 2009 with 1 comment
-
Update table field by replacing a string value with a new oneat August 28, 2008
-
Table Sorting, Filtering etc. from JavaScript Toolboxat December 24, 2008
-
An Advanced Lightweight JavaScript Table Sorter: TinyTable V3at November 19, 2009

One Reply to "Get maximum ID from a table"
March 3, 2009 at 9:25 AM
Mixing of GROUP columns (MIN(),MAX(),COUNT(),…) with no GROUP columns is illegal if there is no GROUP BY clause