可能重复:
Mysql 一次不能执行超过 1 个查询
$query = "TRUNCATE TABLE nw_world;";
$query = $query . " INSERT INTO `nw_world`";
$query = $query . " SELECT * FROM `x_world` WHERE x <0 AND y >=0";
$query = $query . " AND tid !=5 AND aid NOT IN ( 29, 908, 935, 941, 950 )";
$query = $query . " AND population <=50";
echo "$query";
mysql_query($query,$con) or die("error ".mysql_error());
这会导致错误
error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO `nw_world` SELECT * FROM `x_world` WHERE x <0 AND y >=0 AND tid !=5 ' at line 1
但是当我在 mysql 中执行相同的查询时,它工作正常。因此,我有一种感觉,我在 php 编码中犯了一些错误。请帮忙