<分区>
我可能已经看这个太久了,但我没有看到错误。任何帮助将不胜感激。
错误:
Error occurred in [INSERT INTO 'PlayerSats' (username,character,FirstPlay) VALUES ('WaxyChicken','20','FALS')]: 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 ''PlayerSats' (username,character,FirstPlay) VALUES ('WaxyChicken','20','FALS')' at line 1
请注意,“PlayerSats”不是拼写错误,而是正确地大写。
代码:
if ($Funct == "SETFIRSTPLAY") {
$sql = "INSERT INTO $PlayerStats (username,character,FirstPlay) VALUES ('$username','$Char','FALS')";
mysql_query($sql) or die("Error occurred in [$sql]: " . mysql_error());
echo "SUCCESS";
}
表结构:
CREATE table PlayerStats (
ID int(10) unsigned not null auto_increment,
username char(20) not null default '' utf8_general_ci,
character char(2) not null default '00' utf8_general_ci,
invLand char(115) not null default '000:99' utf8_general_ci,
FirstPlay char(4) not null default 'true' utf8_general_ci,
Bank int(20) unsigned not null default 2000
);