Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.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错误:1109(未知表';多删除中的表U名称')";?_Php_Mysql_Sql_Join_Sql Delete - Fatal编程技术网

Php “如何解决此错误”;MySQL错误:1109(未知表';多删除中的表U名称')";?

Php “如何解决此错误”;MySQL错误:1109(未知表';多删除中的表U名称')";?,php,mysql,sql,join,sql-delete,Php,Mysql,Sql,Join,Sql Delete,我在我的网站上使用PHP和MySQL(服务器版本:5.5.31-0ubuntu0.12.04.2),当我运行以下查询时,它给出了上述错误。我找不到这个错误背后的任何线索。有人能帮我解决这个错误并建议对现有查询进行任何更改吗?我将我的问题写在下面供您参考: DELETE ABC.theory_sheet_set, ABC.theory_sheet_questions FROM ABC.theory_sheet_set AS theory_sheet_set, OCN.the

我在我的网站上使用PHP和MySQL(服务器版本:5.5.31-0ubuntu0.12.04.2),当我运行以下查询时,它给出了上述错误。我找不到这个错误背后的任何线索。有人能帮我解决这个错误并建议对现有查询进行任何更改吗?我将我的问题写在下面供您参考:

DELETE
   ABC.theory_sheet_set,
   ABC.theory_sheet_questions
FROM
   ABC.theory_sheet_set AS theory_sheet_set,
   OCN.theory_sheet_questions AS theory_sheet_questions
WHERE
   theory_sheet_set.theory_sheet_set_id = theory_sheet_questions.theory_sheet_set_id
   AND theory_sheet_set.theory_sheet_id=".$theory_sheet_id
它给出的误差如下:

MySQL Error: 1109 (Unknown table 'theory_sheet_set' in MULTI DELETE)
Session halted.

我的数据库名是ABC。实际上,所有表名都是有效的,并且该查询中涉及的所有表都存在于数据库中。你能帮我解决这个问题吗

出现语法错误,请尝试此选项

DELETE *
FROM
theory_sheet_set theory_sheet_set
INNER JOIN 
theory_sheet_questions theory_sheet_questions ON  
theory_sheet_set.theory_sheet_set_id = theory_sheet_questions.theory_sheet_set_id
WHERE theory_sheet_set.theory_sheet_id=".$theory_sheet_id

如果您在查询开始时(即在单词DELETE之后)在查询中使用稍后使用的别名,那么它将很好地工作。唯一的问题是它无法从数据库中识别表,因为您使用别名将这些表引用到数据库中。因此,为了删除此错误,必须在删除后使用查询中使用的别名s。更正后的查询将如下所示:

DELETE theory_sheet_set, theory_sheet_questions FROM ABC.theory_sheet_set AS theory_sheet_set, ABC.theory_sheet_questions AS theory_sheet_questions  WHERE theory_sheet_set.theory_sheet_set_id=theory_sheet_questions.theory_sheet_set_id AND  theory_sheet_set.theory_sheet_id="$theory_sheet_id

所以你想说你比Mysql服务器更了解它,对吗?那么,我建议您联系软件供应商,打电话给他们的支持热线(是的,他们有电话支持),并报告错误。