Multiple Scripts With the Same MySQL Query Running At Once => Will There Be Interference?

Posted by walden on Stack Overflow See other posts from Stack Overflow or by walden
Published on 2010-05-30T19:11:50Z Indexed on 2010/05/30 19:12 UTC
Read the original article Hit count: 219

Filed under:
|

I want to have multiple scripts running from cron at the same time. They will all update, say, 500 rows with a unique status ID for that particular script to use.

If each script grabs the same type of rows to update, and the scripts run at once, will there be interference between the queries run at the same time? For example, using this query:

UPDATE table SET status = <unique script ID> WHERE status = 0 LIMIT 500

Will I get the same rows updating more than once? I'm trying to get each script to get unique rows. I was thinking of using sleep() to make the queries run at different times, but I'm not sure if that's necessary.

Thanks.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql