1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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.
    SEMrush
     
    Solved! View solution.
    piropeator, Jan 3, 2017 IP
    SEMrush
  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