MySQL 1064错误意思是说我的SQL语法错误,然后显示错误的具体位置。查看待更新的内容,以及执行跟新的php语句。php语句如下:if(!$handle= @fopen($fname, "r")) {echo "open $fname failed
";exit;};
$str="";$count=0;
$ins="INSERT INTO pydot_g (id, aauthor) VALUES";
while(($buf=fgets($handle, 1000)) !== false){
list($id,$field) = explode("#",$buf);
$str .= sprintf("(%d,"%s"),",$id,$field);
$count++;
}
$str.="(3955,"3955")";
$dup="ON DUPLICATE KEY UPDATE aauthor=VALUES(aauthor);";
$sql=$ins.$str.$dup;
//echo $sql."
";
if(!mysql_query($sql))
{echo "mysql failed
";
echo mysql_errno() . ": " . mysql_error() . "
";}
fclose($handle);
mysql_close($link);待跟新的内容如下:1320#CarryDream Int"l Co., Ltd.
1321#ES APP Group
1322#app4uu从中可以发现待跟新的内容中还有单引号“‘”,使用的sql语句中打印的字段也含有单引号,两者产生了冲突。所以解决的办法就是,将sql中的语句改为使用双引号““”,至此问题得以解决。MySQL错误:ERROR 1064 (42000): use near "order’解决 http://www.linuxidc.com/Linux/2012-10/73097.htmMySQL报错ERROR 1044 ERROR 1064 (42000): http://www.linuxidc.com/Linux/2013-01/78359.htmOracle 10g物理DG详细配置方法及步骤MySQL中文乱码问题相关资讯 MySQL 1064 本文评论 查看全部评论 (0)