MySQL Forums
Forum List  »  Newbie

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?
November 26, 2010 07:41AM
November 26, 2010 07:48AM
November 26, 2010 07:56AM
November 26, 2010 08:24AM
November 26, 2010 08:29AM
November 26, 2010 08:32AM
November 26, 2010 09:08AM
November 26, 2010 09:35AM
November 26, 2010 11:38AM
November 26, 2010 04:07PM
November 26, 2010 08:40PM
November 27, 2010 04:22AM
November 27, 2010 04:27AM
November 27, 2010 04:37AM
November 27, 2010 04:43AM
November 27, 2010 05:25AM
November 27, 2010 05:44AM
November 27, 2010 05:49AM
November 27, 2010 12:38PM
November 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.