Jump to content

php mysql query, one at a time


mavoric

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

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.