mysql错误1064_MySQL 1064错误原因及解决办法
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 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 "