Announcement

Collapse
No announcement yet.

Modifying a single-selection menu user profile field

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Modifying a single-selection menu user profile field

    I have a user profile field that is a single-selection menu and I have 3 questions about making modifications to the list of choices. I do not know how user choices are actually stored in the database tables, which leads to my questions.

    Let's say the user profile field is "Favorite color" and the choices are
    • blue
    • green
    • red
    • orange
    • yellow
    My current users have each made a choice from this list.

    Question 1: If I add new choices at the end like this:
    • blue
    • green
    • red
    • orange
    • yellow
    • black
    • white
    will all previous user choices be preserved? In other words, will a user who picked "yellow" before I updated the list still have "yellow" as their choice? I'm sure the answer is yes, but I'm double-checking before I ask the other questions.

    Question 2: Suppose a user picked "yellow". If I use admincp to change the choices to
    • sky blue
    • olive green
    • brick red
    • tangerine orange
    • sunny yellow
    • coal black
    • off white
    New users can obviously pick from the updated list, but will that previous user's choice still be "yellow" or will it now be "sunny yellow"?

    Question 3: Suppose I insert new choices in the middle of the list, e.g.,
    • sky blue
    • navy blue
    • olive green
    • brick red
    • blood red
    • tangerine orange
    • pale orange
    • sunny yellow
    • coal black
    • off white
    If a user originally chose "sunny yellow" (which was 5th in the list at the time), will their choice still be "sunny yellow" (now 8th in the list) or will it now be "blood red" (now 5th in the list)?

    From the database point of view, I'm asking if a user's choice is stored as a string, an index into an array of strings, or a unique ID that stays with a particular string.

    Thanks a lot!

  • #2
    In Single Selection Radio Buttons the information is stored as a string. Updating the list does not update the choice that the user has made. However, the next time they edit their profile the option will be removed.

    In Multiple Selection Check Boxes the information updates in the users profile and is not removed the next time the profile is updated.
    Kerry-Anne :)

    Twitter Blog

    www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

    Comment


    • #3
      Thanks for taking the time to reply.

      From what you say, I believe the answers to my questions are as follows:

      Question 1: If I add new choices at the end of the list, a user who had previous picked "yellow" will still be "yellow", whether or not they subsequently update their profile, because it's still a valid choice.

      Question 2: If I rename all of the choices in the list, a user who had previous picked "yellow" will still be "yellow", but if they subsequently update their profile and don't pick a choice from the new list then their choice will become blank.

      Question 3: If I add new choices in the middle of the list, a user who had previous picked "sunny yellow" will still be "sunny yellow", whether or not they subsequently update their profile, because it's still a valid choice.

      Is that correct?

      Comment

      Loading...
      Working...
      X