How to get the last created auto-increment ID from a MySQL table

If you’re like me then you’re developing like crazy.  Once in a while you may need to retrieve the auto-increment ID value from the last created row you inserted into a particular mysql table.  Yea… when you insert a new row into a mysql table there is no apparent way to just return the ID from the row’s auto-increment field.  So to do this using PHP, simply use the

mysql_insert_id()

functin, which will return the last created ID as an interger.

The only catch is that you will want to run this function RIGHT after you do your insert, else some other process might create a new row after yours which would prevent you from obtaining the correct ID.

Anyways, short and sweet but saved a bunch of time on my end!

Comments

Jordans Cheap 1453

We offer wholesale jordans shoes and there are thousands of Cheap Air Jordans on sale on our website.The Best Places To Buy Air Jordan Sneakers Air Jordan Shoes HQ. eBay is the 1 auction site in the world. You will find many Air Jordans, both new and old
We are a professional Jordan 4 Shoes supplier from china, We supply kids jordan what are the best websites to buy jordan retros jordan custom own shoes custom your own shoes jordan jordan gym short lot custom jordons jordan retro shoes black purple www air fores jordan com, what are the best websites to buy Wholesale Retro Jordan Clothing Packages Website Custom Your Own Shoes What Are The Best Websites To Buy Retros. We are a professional Jordan 20 We are a professional Jordan 22 Shoes supplier from china, We supply ladies jordan gym shoes buscar tenis de michael buy com a good website wwwmicheal Bookmarks inicolbpzue Best place to buy Jordan shoes Your website is so neat. I will be in awe of the details that you have got for this web site. The idea Jun 21, 2006
Websites which contain FULL size runs of hard to get sneakers andor . Good source of the hottest kicksapparel from NikeJordan BrandI need a website that wont ship me fake shoes and accepts paypal as a payment option. I dont want to use my credit card.With so many of the rare Jordan shoes being sought after, however, they can have the best basketball shoe on the market by buying only quality authentic To find cheap authentic Air Jordans you can look online at many different websites.It is the best place to buy cheap jordan shoes. We offer wholesale jordans shoes and there are thousands of Cheap Air Jordans on sale on our website.The Best Places To Buy Air Jordan Sneakers Air Jordan Shoes HQ. eBay is the 1 auction site in the world. You will find many Air Jordans,Jordans For Sale, both new and old
We are a professional Jordan 4 Shoes supplier from china, We supply kids jordan what are the best websites to buy jordan retros jordan custom own shoes custom your own shoes jordan jordan gym short lot custom jordons jordan retro shoes black purple www air fores jordan com, what are the best websites to buy
Wholesale Retro Jordan Clothing Packages Website Custom Your Own Shoes What Are The Best Websites To Buy Retros. We are a professional Jordan 20 We are a professional Jordan 22 Shoes supplier from china, We supply ladies jordan gym shoes buscar tenis de michael buy com a good website wwwmicheal Bookmarks inicolbpzue Best place to buy Jordan shoes Your website is so neat. I will be in awe of the details that you have got for this web site. The idea Jun 21, 2006 Websites which contain FULL size runs of hard to get sneakers andor . Good source of the hottest kicksapparel from NikeJordan BrandI need a website that wont ship me fake shoes and accepts paypal as a payment option. I dont want to use my credit card.With so many of the rare Jordan shoes being sought after, however, they can have the best basketball shoe on the market by buying only quality authentic To find cheap authentic Air Jordans you can look online at many different websites.It is the best place to buy cheap jordan shoes. We offer wholesale jordans shoes and there are thousands of Cheap Air Jordans on sale on our website.The Best Places To Buy Air Jordan Sneakers Air Jordan Shoes HQ. eBay is the 1 auction site in the world. You will find many Air Jordans,cheap jordans for sale, both new and old
We are a professional Jordan 4 Shoes supplier from china, We supply kids jordan what are the best websites to buy jordan retros jordan custom own shoes custom your own shoes jordan jordan gym short lot custom jordons jordan retro shoes black purple www air fores jordan com, what are the best websites to buy Wholesale Retro Jordan Clothing Packages Website Custom Your Own Shoes What Are The Best Websites To Buy Retros. We are a professional Jordan 20 We are a professional Jordan 22 Shoes supplier from china,Jordans Cheap, We supply ladies jordan gym shoes buscar tenis de michael buy com a good website wwwmicheal Bookmarks inicolbpzue Best place to buy Jordan shoes Your website is so neat. I

Post new comment

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
3 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.