I'm wondering, say I have a table in my MySQL database called "stuff" which has a primary key called stuffid.
How do I get the last stuffid which is also always going to be the largest number.
I considered doing a loop and just compare everything to the current largest stuffid to get the largest stuffid but figured there had to be a better way for that.
I'm not looking for how to get the id of the item I just inserted. This is for data that already exists and I want the id for the largest from the stuff that's already there.
Any clues?
Thanks,
KABOOM!