Get maximum ID from a table
Posted on August 30, 2008, under PHP,
Bookmark it
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
Related Posts
-
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
-
Advanced Lightweight JavaScript Table Sorter: TinyTable V3at November 19, 2009 with 1 comment
-
Create, Customize and Send Newsletters: MeeNewsat August 3, 2009 with 3 comments

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