Jump to content

Simultaneous entry question


PieFreak

Recommended Posts

I\'ve got a script that allows a user to create a group which can be identified by the variable group_id. After the creation process is complete, my script checks the database for the latest group_id to be entered and uses that id to enter the group lobby automatically.

 

The problem comes about if a person creates a group and is just about to be forwarded to his/her lobby when another user also creates a group and the script takes the second person\'s group_id as the latest entry.

 

Any ideas on how to get around this?

Link to comment
Share on other sites

If you\'re using a session, then the last_entered_id function of mysql and php is session specific.

 

It only keeps track of the auto_increment values. If you\'re NOT using that, then you\'ll have to keep that variable in your php script and save it until finished with the creation...

 

It seems like you\'re using an auto_increment for group_id though... So... you should probably just use sessions.

 

P.

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.