Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 我试图从邮递员那里发送post请求,但在第一次请求被接受时,数据被存储为null_Php_Mysql_Sql - Fatal编程技术网

Php 我试图从邮递员那里发送post请求,但在第一次请求被接受时,数据被存储为null

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* {

//mysql表创建

//邮递员要求

//邮递员的输出

但是它对于get请求很有效。任何帮助都将不胜感激

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"
}