Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- START TRANSACTION;
- SELECT @id := id, ip, port, type FROM ip WHERE (isnull(get_time) or get_time < now() - interval 24 hour) and status = 'new' and (SELECT count(*) FROM acc_reg WHERE ip = ip.ip and ban = 1) = 0 ORDER BY get_time LIMIT 1 FOR UPDATE;
- UPDATE ip SET get_time = now() WHERE id = @id;
- COMMIT;
Add Comment
Please, Sign In to add comment