我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

mysql参数允许插入空字符串而不是NULL

In my database tables there are fiels which can be NULL of different types: integer, date, datetime, etc.

The first of our computer treats well this code:

INSERT INTO table VALUES (..., '', '', ...)
INSERT INTO table VALUES (..., NULL, NULL, ...)

The second one treats only code with NULL, but gives error with empty string.

I wonder, how to change MySQL parameters to force the second one work properly.

Thanks in advance

近期文章

  • 为什么在使用for循环时不会填充我的选项列表
  • 如果用户未被授权,则Yii权限模块重定向到另一页面403
  • 如何在mysql php中从数据库中回显一个未选中的选项值
  • Codeigniter和套接字
  • PHP SQL查询服务器错误
  • Arduino和php之间的联系
  • 使用mcrypt和enigma算法
  • cURL不适用于指定的站点
  • 不了解连接功能
  • HTML - 将表单数据作为序列化的json发送
  • 仅将1个数据插入数据库PDO
  • 数组到字符串转换在Codeigniter中
  • 在共享主机上使用PHP进行Git clone / pull
  • NuSOAP头部认证PHP Web服务
  • 分配给可选的参考参数
  • 从另一个页面/表单自动填充表单对象
  • 无法重定向到新页面 - CodeIgniter
  • 带有表单提交的PayPal按钮 - 最佳实践
  • Paypal将item_number从paypal传递到我的脚本
  • 在Laravel中的同一个环境中通过URL更改调试模式

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华