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!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.