错误提示YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorrespondstoyourMySQLserverversionfortherightsyntaxtousenear''atline1我死也看不出来哪里有错。$sql1="SELECT*FROM`c...
错误提示
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 '' at line 1
我死也看不出来哪里有错。
$sql1="SELECT * FROM `count` WHERE `uname`='{$fromUsername}'";
$r1=mysql_query($sql1);
if(!$r1){$r1=mysql_fetch_array($r1);
$n=$r1['ct'];
$m=$n;
$n++;
$sql2="UPDATE `count` SET `ct`={$n} WHERE `uname`='{$fromUsername}'";
mysql_query($sql2);
}
else{
$m=1;
$n=2;
$sql1="INSERT INTO `count`(`uname`, `ct`) VALUES ('{$fromUsername}',{$n}";
mysql_query($sql1);}
错误是 else那里 mysql_query后面mysql_error()出来的。
展开