The difference between null and NULL in MySQL

Source: Internet
Author: User

Web development in contact with PHP for some time, in the database operation often encountered a problem, so that the same field in the page display with 3 types of null,null and Numbers , the solution is to define this field as a varchar type, quotation marks when inserting data have not been studied in depth. Today's problem has come up again, when the inserted value is null, the page display is empty! Careful study found that:

1. When you insert ' null ' and ' null ' into the data table, the data table displays null and empty, respectively.
2. When you insert null into the data table, it is displayed in the datasheet as null.
3. When you select ' null ' from the database, only the part of insert that is ' null ' is displayed as null.
4. When you select null from the database, only the part of insert that is null is displayed as NULL.

Further, it is concluded that the data table ' NULL ' and null are different concepts, although the display is the same. In fact, NULL is a relatively special field. In the MySQL database, in different situations, null values often represent different meanings. and ' NULL ' is the character type, mainly the two show the same, in the database is not very familiar with the students are prone to confuse ⊙﹏⊙.

Reference: http://blog.csdn.net/eroswang/article/details/8529817

The difference between null and NULL in MySQL

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.