SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Change ENUM Values

    I am following an example in my book dealing with an ENUM data-type.

    My table already has values in it, and I would like to change one ENUM value from "Admin" to "Administrator" and also change the corresponding field values.

    How would I do this?


    Debbie

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,247
    Mentioned
    59 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    How would I do this?
    rather tediously, i'm afraid

    see http://forums.htmlcenter.com/databas...ype-mysql.html

    just another example of why you should stay well clear of the evil SET and ENUM datatypes

    but i'll bet your book didn't give you that type of advice
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    rather tediously, i'm afraid

    see http://forums.htmlcenter.com/databas...ype-mysql.html

    just another example of why you should stay well clear of the evil SET and ENUM datatypes
    I was waiting for you to say that! (I've heard you don't like ENUM!)


    but i'll bet your book didn't give you that type of advice
    Well, you get what you pay for, and this book is far from advanced. But for a newbie like me, it is a good way to get up to speed on PHP and MySQL.

    Once I get the author's code working, I'll go create my own site/code from scratch and try to learn from things like this.


    Debbie

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,807
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The book "SQL Antipatterns" covers a lot of the things that are often done wrong with databases. It has a whole chapter on avoiding using enum and what the alternatives are that you could use instead.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The book "SQL Antipatterns" covers a lot of the things that are often done wrong with databases. It has a whole chapter on avoiding using enum and what the alternatives are that you could use instead.
    Good suggestion!


    Debbie


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
  •