Mysql Null String

Source: Internet
Author: User
A php page processes the data submitted by the user. The processing of the field name is to determine whether the isset exists, and then use the thinkphp verification rule require to determine whether it is empty. A name field in mysql is not set to null, but is there a blank string record in the table? What are the causes of this problem? A php page processes the data submitted by the user. The processing of the field name is to determine whether the isset exists, and then use the thinkphp verification rule require to determine whether it is empty.
A name field in mysql is not set to null, but is there a blank string record in the table?
What are the causes of this problem?

Reply content:

A php page processes the data submitted by the user. The processing of the field name is to determine whether the isset exists, and then use the thinkphp verification rule require to determine whether it is empty.
A name field in mysql is not set to null, but is there a blank string record in the table?
What are the causes of this problem?

In mysql, null and null strings are different.
If the field value is left blank in mysql, the default value is null.
Your name field is set to not null, so you must have a value before it can be inserted successfully, but this value can be a null string.

Check your code, cool.

You can print out the SQL statement you inserted into the database.
Whether the correct value has been obtained
Whether the field name is consistent with the mysql column name

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.