Thanks for the help guys.
The site is very busy and I am trying to figure out the most efficient way to do it.
Originally we used a user-supplied user_id as the primary key to reference all the other tables. However, in preparation for a new sign up form where some users would only supply an email address (and not a member name/user_id), I introduced a new primary key called pin_id which is auto_incremented.
However, not wishing to have duplicated member names (even when people only supply an email address), I made the user_id field an UNIQUE KEY. However, it seems that having 2 empty string user_id rows violates this and MYSQL does not allow me to just insert an email address by itself - I have to insert an unique user_id.
So it seems that I would need to figure out a way to insert an UNIQUE user_id into the user_id field when I first insert the email address (OR IS THERE A WAY TO GET AROUND THIS? I tried "NULL" but that did not work).
I am not familiar with table locking and based on Tim's post I would hope to avoid taking that route. I could just use the email address (it is UNIQUE) for the user_id but the email address can go up to 100 characters and user_id can only go up to 16 (hence an UNIQUE email address might have the same first 16 characters).
Tim, when you wrote "I'd probably do it with 2 queries if you absolutely have to do it, or make the user_id a md5() hash of the microtime() or find some other unique number to put in there.", can you give me an example of doing it using 2 queries?
Also, suppose 2 people filled out the forum and submitted at the EXACT same time, wouldn't that produce a duplicate if I use the md5() hash?
Best Wishes and thank you for your help.
tennisguy