|
-
Jul 22nd, 2007, 09:43 PM
#15
Thread Starter
No place like 127.0.0.1
Re: Locking a row from being READ
I'll be honest, I didn't understand your reply that well.
I gave in and figured out how to do multi-queries in PHP and came up with this:
DROP TABLE IF EXISTS artists_temp;
CREATE TEMPORARY TABLE artists_temp SELECT sql_id FROM artists WHERE status=0 LIMIT 20;
SELECT * FROM artists_temp;
UPDATE artists SET status=1 WHERE sql_id IN (SELECT sql_id FROM artists_temp);
It works fine. I can't foresee any problems with running this asynchronously unless MySQL decides to squeeze other queries inbetween these, but I don't think that is a possibility. As long as these all run in sequence, I'll be fine.
Thanks again for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|