Data type to save one character

Discussion in 'MySQL' started by piropeator, Jan 3, 2017.

  1. #1
    Hi! I have a question about data type using MySQL.
    I have a auxiliary table CONDITION, its values are:
    Pending, Active, Closed.
    What is better option:
    id / condition
    1   Pending
    2   Active
    3   Closed
    
    PHP:
    or
    id / condition
    P   Pending
    A   Active
    C   Closed
    
    PHP:
    id integer or id varchar(1)?
    I usually use integer / unsigned for the IDs. I accept suggestions. Thanks.
     
    Solved! View solution.
    piropeator, Jan 3, 2017 IP
  2. #2
    My advice : use an integer. The comparison will be faster and the usage will be easier (no problem with the case for example)
     
    Zoidrums, Feb 9, 2017 IP