Jump to content

Its a dumb question but i dont know the answer (mysql_insert_id)


derrick24

Recommended Posts

This is more of a concern of mine, and I'm not too sure of how to even ask this question.

 

I have at the start of my script a normal connect to the database connection that can be used though out the remainder of the script by various functions (so basically any function can simply pull the data it requires without having to connect every time)

 

Now my concern is that I need to use "mysql_insert_id", if I have multiple uses inserting records in the database using the same connection started at the top of the script. Is that going to cause a conflict.

 

ie: if        userA inserts record 1      and      userB insert record 2      at the same time.

 

will userA still get a return id of 1 and userB a return id of 2 and not both get a return of 2 for example?

each user runs the script individually. they each get their own "version" of the code and any connections made through the script. therefore, they don't share the same connection to MySQL and shouldn't interfere with each other in the way you describe.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.