Hi guys,
Long time no speak. Is there anyway to find out the last ID of a DB table. I want to write my own headline animator and so I need to get the last id, count back five and then rotate them (using JS+Ajax).
Any help gratefully received.
What if there is a hole and the last 5 ID's in the table are 90, 89, 88, 87, and 52?
If you wanted the last 5 ID's, though, you could do a basic SELECT query like so:
SELECT id FROM table ORDER BY id DESC LIMIT 5