[blr-facebook-developers] Fwd: A question mysql_insertid()

2 views
Skip to first unread message

Kuberan Marimuthu

unread,
Apr 24, 2010, 4:26:04 PM4/24/10
to bangalore-face...@googlegroups.com


---------- Forwarded message ----------
From: Kuberan Marimuthu <kuberanm...@gmail.com>
Date: Sun, Apr 25, 2010 at 1:54 AM
Subject: A question mysql_insertid()
To: professi...@googlegroups.com


Hi,

This is my requirement:

I have table that has an auto-increment field and once I do an insert into the table from PHP, I need to get the generated auto-increment field. I tried googling solution for this problem and found that mysql_insertid() is the solution for it. My doubt is for a database that has a very high level of concurrency, is it not possible for the auto_increment value to be advanced between the INSERT QUERY and the my_insertid() call in PHP. Is so what is the perfect solution to this problem?

regards,
kuberan

--
Website: http://sites.google.com/site/bangalorefacebookdevelopers/
Facebook Group: http://www.facebook.com/group.php?gid=292286422291
Twitter Handle: https://twitter.com/blr_facebook
Google Group: http://groups.google.com/group/bangalore-facebook-developers
Twitter Hashtag: #bfdm

Sethuraman Vinaitheerthan

unread,
Apr 24, 2010, 9:44:16 PM4/24/10
to bangalore-face...@googlegroups.com
hey qube,

hope this helps.i ve encountered a similar one bfore..



Hi,

This is my requirement:

I have table that has an auto-increment field and once I do an insert into the table from PHP, I need to get the generated auto-increment field. I tried googling solution for this problem and found that mysql_insertid() is the solution for it. My doubt is for a database that has a very high level of concurrency, is it not possible for the auto_increment value to be advanced between the INSERT QUERY and the my_insertid() call in PHP. Is so what is the perfect solution to this problem?

regards,
kuberan

--THANKS AND REGARDS--
---------------SETHU----------------
-----------09964180626 -----------
Reply all
Reply to author
Forward
0 new messages