Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6390693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:34:44+00:00 2026-05-25T03:34:44+00:00

i made a research to a cms’s database: uid(Unique user ID): it set to

  • 0

i made a research to a cms’s database:

uid(Unique user ID): it set to int(11)

name(nique user name it set to varchar(60)

created(tiemstamp for when user was created) it set to int(11)

title the title of article it set to varchar(255)

1, when i should use Int or char or varchar or other types

2, how to set the number in the parenthesis。eg: varchar(60) thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:34:44+00:00Added an answer on May 25, 2026 at 3:34 am

    You should use INT when you want to use primary key (an INT is faster to look for than a string) or calculate data. For example, you want to calculates the number of items someone purchased when ordering some products online. Each line will have the article description, price, quantity ordered (and more – just giving an example here). In this case, by should an INT for quantity it will be easy to retrieve the number of product (total number of products for the invoice) ordered.

    Strings with the type “char” and “varchar” are a little different. The type “char” is defined as follow:

    A fixed-length string that is always right-padded with spaces to the specified length when stored.

    In order words, if you define a first name with char(200), you will use 200 bytes. The varchar type is defined as follow:

    A variable-length string. Note: Trailing spaces are removed when the value is stored (this differs from the ANSI SQL specification)

    In order words, if you define a first name with varchar(255) and the name is “Tim”, you will use 4 bytes. 3 for the name +1 byte for the length of the field.

    Typically, you use char(6) for HTML colors (FFFFFF) and usually you use varchar for names, addresses etc…

    Regarding your second question as of setup the number in the parentheses. This number will set the maximum length of a string. If you set varchar(60) to a field and when you insert or update the record and the length of the string is greater than 60 character then MySQL will truncate the string to use the first 60 characters.

    You can check all the fields types here: http://help.scibit.com/mascon/masconMySQL_Field_Types.html

    You can also read about database normalization: http://en.wikipedia.org/wiki/Database_normalization

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made some research and it seems that Javascript and MIDI are not going
I have made some research on Stackoverflow about reverse for loops in C++ that
I made some research in Google and was unable to find the way to
When answering this question I made some research which really confuses me. I noticed
I've trying to learn PHP OOP and have made some research on how to
I made a research, but I didn't find anything to helps me answer this
I've made some research on this but haven't found any solution, so I'm not
i have a problem and confused a little bit. I made some research in
I want to write a plugin to validate forms. I have made detailed research
I am creating turistic app and I have made some significant research about design.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.