MySQL Forums :: Newbie :: Last/highest ID?


Advanced Search

Last/highest ID?
Posted by: Wesley notrelevant ()
Date: November 26, 2010 07:41AM

Hey all. I currently have a table named 'paintedhats'. A form inserts values to it, and everything works great. 'paintedhatid' is an auto incrementing value. Now, I have to get the last or highest id from the database, to add one to it, so I can use it for renaming an image. It might bea bit confusing, but all I need to know is:

How do I retrieve the 'paintedhatid' latest inserted row? And, am I able to add one to it?

Retrieving the latest 'paintedhatid' would be 150. I'll save that to a variable ($latesthatid), and would like to add one to it ($latesthatid++;). Would that work?

Options: ReplyQuote


Subject Written By Posted
Last/highest ID? Wesley notrelevant 11/26/2010 07:41AM
Re: Last/highest ID? Hari sankar A 11/26/2010 07:48AM
Re: Last/highest ID? Wesley notrelevant 11/26/2010 07:56AM
Re: Last/highest ID? laptop alias 11/26/2010 08:24AM
Re: Last/highest ID? Wesley notrelevant 11/26/2010 08:29AM
Re: Last/highest ID? laptop alias 11/26/2010 08:32AM
Re: Last/highest ID? Wesley notrelevant 11/26/2010 09:08AM
Re: Last/highest ID? laptop alias 11/26/2010 09:35AM
Re: Last/highest ID? Wesley notrelevant 11/26/2010 11:38AM
Re: Last/highest ID? Rick James 11/26/2010 04:07PM
Re: Last/highest ID? Wesley notrelevant 11/26/2010 08:40PM
Re: Last/highest ID? David Garstang 11/27/2010 04:22AM
Re: Last/highest ID? Wesley notrelevant 11/27/2010 04:27AM
Re: Last/highest ID? David Garstang 11/27/2010 04:37AM
Re: Last/highest ID? Wesley notrelevant 11/27/2010 04:43AM
Re: Last/highest ID? David Garstang 11/27/2010 05:25AM
Re: Last/highest ID? David Garstang 11/27/2010 05:44AM
Re: Last/highest ID? Wesley notrelevant 11/27/2010 05:49AM
Re: Last/highest ID? Wesley notrelevant 11/27/2010 12:38PM
Re: Last/highest ID? laptop alias 11/26/2010 07:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.