我可能只是看这个太久了,但我没有看到错误。任何帮助,将不胜感激。
错误:
[INSERT INTO 'PlayerSats' (username,character,FirstPlay) VALUES ('WaxyChicken','20','FALS')] 发生错误:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 ''PlayerSats' (username,character,FirstPlay) VALUES ('WaxyChicken','20','FALS')' 附近使用正确的语法
请注意,“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
);