I'm looking for a solution for the following situation:
I have a tournaments table in mysql which has a maximum amount of sign ups. When a sign up occurs it's inserting the row in the tournament_players table.
My main problem is I don't know how to avoid the case when two or more sign ups occur at the same time and they exceeds the maximum amount of sign ups. I was researching about the transaction but I don't really understand how it works in practice. May I lock only the row or the whole table? AFAIK I know first needs InnoDB the second need MyIsam. Which is the best for my problem?