gpt4 book ai didi

php - 我的 PHP/MySQL 语法错误在哪里?

转载 作者:行者123 更新时间:2023-11-29 04:48:14 25 4
gpt4 key购买 nike

<分区>

我可能已经看这个太久了,但我没有看到错误。任何帮助将不胜感激。

错误:

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
);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com