Gee. I never thought of that.
The User_ID column in the "Users" table in the MySQL database is set as the primary key.
Using either method the MySQL database would not allow duplicate entries - I don't think.
The PHP manual says that you can insert a rand() function to make the hash even more unique.
// Below per the PHP Manual:
$token = md5(uniqid(""));
echo "$token<p>";
// better, difficult to guess
$better_token = md5(uniqid(rand(""), true));
echo $better_token;
The md5() function, used by itself, creates the exact same hash for the same username each and every time. The above functions create different 32-character random hashes each time with the same username.
I suppose that by even an infintesimally small chance two users should get the same 32-character hash then, since the User_ID column is set as the primary key the MySQL database would let only one of the User_ID's register.
The md5(uniqid(rand())) is a better method I believe.
The "BIGINT" column won't admit a thirty-two character string. Should I use a "BLOB," a "CHAR," or a "TEXT" for the column type?