What's the correct way to implement a PHP/MySQL transaction locking mechanism
<p>For example suppose you send a newsletter to several thousand subscribers and you advertise "The first hundred to click on this link get a 10% discount".  As an extreme example assume thousands of clicks arrive within a few seconds.  What's the correct way of making sure that after exactly the 100th click things are locked so that there is no chance of 101 or 102 customers getting the "congratulations on getting the discount message"</p>
