首页 > 解决方案 > 发生数据库错误错误号:1048 列'captcha_time'不能为空

问题描述

请帮助删除以下错误

A Database Error Occurred
Error Number: 1048

Column 'captcha_time' cannot be null
INSERT INTO `captcha_table` (`captcha_time`, `captcha_ip_address`, `captcha_word`) VALUES (NULL, '27.60.102.123', NULL)

Filename: models/dashboard/Common_model.php

Line Number: 13

标签: mysqlsql-insert

解决方案


您正在尝试将 NULL 插入到 captcha_time 列中,如果您在其中添加一个值,它将修复它,但是您的问题并没有让我清楚地了解它,而且如果您在 captcha_table 上禁用 NOT NULL 约束,您将能够在其中插入空值captcha_time,你应该分析什么对你来说是正确的。

 INSERT INTO `captcha_table` (`captcha_time`, `captcha_ip_address`, `captcha_word`) VALUES (1234, '27.60.102.123', NULL)

推荐阅读