SunQuest
           Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old November 18th, 2003, 04:44 PM
nego nego is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cracow, POland
Posts: 29 nego User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m
Reputation Power: 0
mysql_insert_id()

hi

i inserted a row into mysql table
i need to know last autoincrement number
what is most safe?
do a select and check field which i inserted (in this way i must improve indexes)
or use mysql_insert_id() ?
but i'm not sure that it retuern the real number of row (because this table can be accessed/inserted many times simultaneously)

thank you in advance

Reply With Quote
  #2  
Old November 18th, 2003, 06:18 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: mysql_insert_id()

mysql_insert_id()

Reply With Quote
  #3  
Old November 18th, 2003, 06:22 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: mysql_insert_id()

I use mysql_insert_id in a very active application and have never had a problem. I read somewhere that it is based on the current connection, so you will never get the wrong id returned.

Reply With Quote
  #4  
Old November 18th, 2003, 06:33 PM
nego nego is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Cracow, POland
Posts: 29 nego User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m
Reputation Power: 0
RE: mysql_insert_id()

oki thx

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > mysql_insert_id()


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway