xrubio.com
Atomically increment a limited value in MySQL and PHP
Sometimes you need to acquire a limited resource in an atomically, concurrent way. This is what semaphores are for. But when this resource is in a MySQL row, apparently there is no straightforward …