field with individual data type possible? (mySQL, MariaDB)

Discussion in 'MySQL' started by iago111, Sep 6, 2020.

  1. #1
    Hello, I would like to create a table and incorporate an indivudal data typa: eg.: datatype 'state' with values like { 'pending', 'confirmed','declined' } How can I do this? Thanks!
     
    iago111, Sep 6, 2020 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,832
    Likes Received:
    4,541
    Best Answers:
    123
    Trophy Points:
    665
    #2
    You can set a default value eg New in the database but the control over what values the user chooses, or are assigned automatically as a work order progresses, is up in PHP or the scripting language you use.
     
    sarahk, Sep 6, 2020 IP
    iago111 likes this.
  3. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #3
    You can use this as "char" or "varchar" type. Then your php code sends values as you want, confirmed or pending or whatever else you want.
     
    JEET, Sep 15, 2020 IP
    iago111 likes this.