ThinkPHP3.2.3, what does this mistake mean?

Source: Internet
Author: User
Here is the code, the same code, the same database table, in the local WAMP environment, the following error is reported.
The lamp on the server, there is no problem.
The last few months have been normal for a sudden mistake.

    1. The problem is, in my database table, there is no alias in this field, where does it come from?

//写数据库//---------------------$data['user_mail'] = $user_mail;$data['user_name'] = $user_name;$data['pass_word'] = md5($pass_word);$data['last_time'] = date('Y-m-d H:i:s');$addRes = $usr -> add($data);\Think\log::record("6");

ERR:SQLSTATE[HY000]: General error:1364 Field ' alias ' doesn ' t has a default value

Reply content:

Here is the code, the same code, the same database table, in the local WAMP environment, the following error is reported.
The lamp on the server, there is no problem.
The last few months have been normal for a sudden mistake.

    1. The problem is, in my database table, there is no alias in this field, where does it come from?

//写数据库//---------------------$data['user_mail'] = $user_mail;$data['user_name'] = $user_name;$data['pass_word'] = md5($pass_word);$data['last_time'] = date('Y-m-d H:i:s');$addRes = $usr -> add($data);\Think\log::record("6");

ERR:SQLSTATE[HY000]: General error:1364 Field ' alias ' doesn ' t has a default value

The field cache causes you to delete everything under the runtime directory, excluding the runtime directory itself. But the premise is that your debug mode is false to use the cache, and I recommend that you add a default value to the Alias field, otherwise it might be the reason why the development environment is inconsistent with the on-line environment.

This has nothing to do with TP hair.
Use Google, http://blog.csdn.net/god8816/article/details/8593419

Did you turn on MySQL strict mode?

Your error indicates that your INSERT statement lacks a value for alias, and then the table structure does not define a default value for the alias field;
You should not use the MySQL Sql_mode to hide the problem or implicitly handle the problem through the database.

  • Related Article

    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.