Jump to content

Recommended Posts

Ok I've scanned Google and can't find anything on there that could help me with the rather confusing conundrum. I have a script which searches a database for record and then updates it

 

UPDATE examplefield SET rowfound = 'Y' WHERE rowfound = 'N'  AND anotherparameter = 'sometext' LIMIT 1

 

Simple, however when the code gets run by the browser, and two people run the script at exactly the same time (one in a million chance I know), will the browsers be fighting over the same record and when they run "mysql_affected_rows" will both browsers show the same ID or will they both show different ID's (assuming that there are loads of records which meet the mysql arguement)

 

the reason I'm asking is because it is imperative that each browser shows a different ID and under no circumstances must they show the same!

 

Thanks in advance for any advice :)

Link to comment
https://forums.phpfreaks.com/topic/88926-php-mysql-query-one-at-a-time/
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.