Jump to content

Is it possible that mysql messes up if i insert 2 things the following way...


saintseiya

Recommended Posts

I am inserting a new user into the users table. And a new user options into user options table.

 

I need to relate them both by their ids... and i am getting their upcoming id by grabbing last entry in the table and assuming the new id will become (last id) +1.

 

I do this for both then i insert them each, something like...

 

useroptions_owner='$last_user_id+1'

 

other query:

 

users_options_id='$last_users_options_id+1'

 

I am worried that if the site becomes big this might be a problem if 2 users hit the register button instantaneously. Is this a possible problem by using this method of adding a new user?

 

Should i insert the user, then grab his id by e-mail and then use that id to insert his options in order to remove the possibility of it messing up? Or should I assume mysql is fast enough and this method will never mess up.

 

PS.- dont ask why the options are on a different table or anything like that :P

 

Help appreciated!

 

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.