Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/66.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与mysql错误数据库_Php_Mysql - Fatal编程技术网

php与mysql错误数据库

php与mysql错误数据库,php,mysql,Php,Mysql,我有一个MySQL数据库,我正在尝试将数据表单插入数据库。之后,我输入了无效数据,并给出了错误信息 connection error Cannot add or update a child row: a foreign key constraint fails (`infomags`.`details`, CONSTRAINT `details_ibfk_1` FOREIGN KEY (`cate_id`) REFERENCES `categories` (`id`)) 我试

我有一个MySQL数据库,我正在尝试将数据表单插入数据库。之后,我输入了无效数据,并给出了错误信息

connection error Cannot add or update a child row: 
  a foreign key constraint fails 
  (`infomags`.`details`, CONSTRAINT `details_ibfk_1` FOREIGN KEY
  (`cate_id`) REFERENCES `categories` (`id`))
我试图处理此错误,但它无法读取列,并给了我此错误:

(connection error Unknown column 'category_id' in 'field list')

我会在DBA页面上问这个问题。有这么多信息,没有人能给你任何建议?请指出您认为错误出现的那一行,粘贴您的代码。另外,请以可理解的方式正确阐述您的问题。谢谢。尤其是以可理解的方式。您试图将声音插入
详细信息
表中,但类别ID不存在于
类别
表中。您可以发布代码吗?