PHP tinyint (1) Why is it possible to insert the value of 99?

Source: Internet
Author: User

The MySQL database constrains data by: Data type (m), where the number m represents a different meaning in different data types. The integer system has limited the range of values, tinyint takes up one byte, and int accounts for 4 bytes. So the M after the integer is not the length of the data represented, but the minimum length (length is the number of characters) displayed when the data is displayed.
tinyint (1) Here 1 represents the shortest display of a character. tinyint (2) Here 2 means the shortest display of two characters, but here the light set M is meaningless, you also need to specify when the data is less than the length of M with what to fill, such as Zerofill (indicates that there is 0 padding). Set tinyint (2) Zerofill you insert 1 o'clock he will show 01. Set tinyint (4) Zerofill you insert 1 o'clock he will show 0001.

PHP tinyint (1) Why is it possible to insert the value of 99?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.