SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict Phil-man's Avatar
    Join Date
    Nov 2000
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi:

    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!

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like an application issue to me.

    Could you provide table schema (e.g. CREATE TABLE .. ), the command you are trying to execute and the resulting error?

    Thanks,


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •