Results 1 to 2 of 2
Thread: Unique key can't be updated?
Apr 24, 2001, 08:38 #1
I used phpMyAdmin to make a field - email - "unique". It's not set up as a primary key, just a "unique" key, if that's the proper term. It does what it should: it prevents new users from signing up with an e-mail address for which an account has already been established.
However, apparently, it also prevents the user from later changing his/her e-mail address if it becomes necessary. Is that by design? I'm trying to add the "change e-mail" functionality, and I'm trying to avoid having to remove the "uniqueness" of the field. I know that I can instead write some simple code that will search for the email address in the database whenever a new user signs up and use mysql_num_rows > 0 to determine if it already exists, but I'm trying to avoid going back and changing that since everything works nicely as is. Also, I suppose I could delete the existing record and write a new one that includes any changes, but that seems cumbersome too. Any opinions? Is it by design that a field identified as a unique key cannot be modified? Thanks!