I have a field in my users database, a 6 digit number that is generated upon registration. I use mt_rand(100000, 999999)
to generate the numbers.
Now to the question, to make sure no one gets the same number I need to either make the field UNIQUE (which i think seems the best) instead of some PHP code. Maybe theres some other way I don't know. The question is, whats the best way to do this?