Php 我试图从邮递员那里发送post请求,但在第一次请求被接受时,数据被存储为null
//mysql表创建 //邮递员要求 //邮递员的输出 但是它对于get请求很有效。任何帮助都将不胜感激Php 我试图从邮递员那里发送post请求,但在第一次请求被接受时,数据被存储为null,php,mysql,sql,Php,Mysql,Sql,//mysql表创建 //邮递员要求 //邮递员的输出 但是它对于get请求很有效。任何帮助都将不胜感激 I changed my table into a simpler one 创建表d( namevarchar(45)不为空 )ENGINE=InnoDB默认字符集=utf8mb4 COLLATE=utf8mb4\U 0900\U ai\U ci 我的json是` { "name" : "abc" } *and the response is* {
I changed my table into a simpler one
创建表d
(
name
varchar(45)不为空
)ENGINE=InnoDB默认字符集=utf8mb4 COLLATE=utf8mb4\U 0900\U ai\U ci
我的json是`
{
"name" : "abc"
}
*and the response is*
{
"code": 9999,
"message": "Argument 1 passed to Tqdev\\PhpCrudApi\\Database\\ColumnsBuilder::quoteColumnName() must be an instance of Tqdev\\PhpCrudApi\\Column\\Reflection\\ReflectedColumn, null given, called in C:\\Users\\vimy9\\OneDrive\\Desktop\\clone\\php-crud-api\\api.php on line 4892"
}
查询中有
id int NOT NULL
,但插入时没有传递id,如果希望自动生成id,它应该是id int NOT NULL auto_INCREMENT
显示表定义(show CREATE table{tablename}
),您正在执行什么代码?生成的具体命令是什么?欢迎使用SO。请提前提供模式详细信息。您必须在更简单的表中指定主键。或者更好的方法是“int unsigned not null auto increment”`错误已清除,感谢您的解决方案。
{"code":1010,"message":"Data integrity violation"}
I changed my table into a simpler one
"name" : "abc"
}
*and the response is*
{
"code": 9999,
"message": "Argument 1 passed to Tqdev\\PhpCrudApi\\Database\\ColumnsBuilder::quoteColumnName() must be an instance of Tqdev\\PhpCrudApi\\Column\\Reflection\\ReflectedColumn, null given, called in C:\\Users\\vimy9\\OneDrive\\Desktop\\clone\\php-crud-api\\api.php on line 4892"
}