Jump to content

Mysql help with forming insert/select


DarkReaper

Recommended Posts

Okay here is what i have in theory:
A list of users.
1. If a user clicks on another users name mysql inserts a row in the db saying that the users requests lets say "chat".
2. set a session var to the row id for the 1-st user.
3. The second users sees that its attention is requested and clicks on the above users name, mysql update-s the row acccoudingly.
4. set a session var to the row id for the 2-nd user
5. Both users do their "chat".

So far so good. But if both users click at the same time 2 rows get inserted (sometimes), usually the 2 sessions vars should be the same but they are not since mysql inserted 2 rows and the 2 vars are different, and the whole module gets to hell cous one user thinks it is "chatting" with someone as is the other, but in fact noone cant see the other couse the 2 rows in the db kinda kill functionallity.

In short 2 rows exist but there should be only 1.

Dont know if you understood me ...

*notice: i say "chat" because i cant think of a word to fully classify it.
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.