1. I've started a massive SPAM purge, any accounts that have spammed are being removed, also for a short period new user signups are disallowed until the SPAM cleaning is finished.

What is the difference between CHAR and VARCHAR data types?

Discussion in 'PHP' started by shepherd, Mar 14, 2013.

  1. shepherd

    shepherd Member

    Joined:
    Feb 28, 2013
    Messages:
    95
    Likes Received:
    0
    Trophy Points:
    6
    Gender:
    Male
    Loading...
  2. mtrick

    mtrick Member

    Joined:
    Nov 17, 2011
    Messages:
    164
    Likes Received:
    4
    Trophy Points:
    18
    Gender:
    Male
    Char Data type having 255 but Varchar having Unlimited
  3. semaphore.v

    semaphore.v Member

    Joined:
    Feb 19, 2013
    Messages:
    105
    Likes Received:
    0
    Trophy Points:
    16
    Gender:
    Male
    CHAR Data Type is a Fixed Length Data Type. VARCHAR is a variable length Data Type.It will take the number of bytes equal to the number of characters stored in the column.
  4. davidsmith

    davidsmith Member

    Joined:
    Jun 21, 2013
    Messages:
    28
    Likes Received:
    1
    Trophy Points:
    6
    In char we can store only character type of data and in varchar we can store character,numbers and special symbols.
  5. webalwaysnext

    webalwaysnext Member

    Joined:
    Feb 3, 2011
    Messages:
    160
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    http://www.paullimo.com
    CHAR should be used for storing fix length character strings. String values will be space/blank padded before stored on disk. If this type is used to store varibale length strings, it will waste a lot of disk space.
    VARCHAR should not be used as it is reserved for future usage.
  6. lukewright

    lukewright New Member

    Joined:
    Dec 26, 2013
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    Yes ur right....
  7. Maureen P. James

    Maureen P. James Member

    Joined:
    Jul 8, 2014
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Gender:
    Male
    Location:
    UK, london
    CHAR data type is a fixed length data type. For example if we write char[10]. It means we can use a variable in length between 1 to 10.
    VARCHAR data type is a variable length data type. For example VARCHAR[]. It stores characters according to the length of string.
  8. Naruka Kumar

    Naruka Kumar Member

    Joined:
    Sep 15, 2014
    Messages:
    13
    Likes Received:
    33
    Trophy Points:
    13
    Gender:
    Male
    Location:
    Delhi
    Hi,
    char-is fixed length data type.
    varchar- is variable length data type.
    Bedi likes this.

Share This Page