I am a newbie at PHP, and am considering using PHP with MySql to give each visitor who signs-up a unique ID-number. I plan to do this by having a single ID-number variable in a MySql database, then each time a visitor signs-up, increment the ID-number variable by one, store their email with this new unique number, (and email the ID-number to them).
I am hoping for lots of traffic, so was wondering if it is ever possible for two visitors to submit the same form at exactly the same time and thus run two actions on the MySql database at the same time, which would result in 2 different visitors having exactly the same ID-number, which, obviously, I don't want.
I am assuming that the actions done on a single MySql database can only do a single sequence of actions (increment variable, read changed variable, store variable and email together, finish) at any time, so there can be no possibility of my programming idea ever resulting in 2 identical ID-numbers, but I thought I'd better make 100% sure before assuming my guess is correct So I guess I am asking, does a sequence of actions get done as a single continuous set before anything else can access the same database, or is it possible for two such sequences to get interleaved so both sequences increment the variable before either has read it? Or if either is possible, how to ensure that a particular action-sequence gets completed before another action-sequence is allowed to start???
thanks in advance for the answer to this