我收到的错误:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 6 行的 'release= 2012-09-02
, platforms= Android
, link=`play.php?game=G'附近使用正确的语法
编码:
$sql = "UPDATE
GameInformation
SET
keyIndex=`GameTest`,
name=`Game Test`,
release=`2012-09-02`,
platforms=`Android`,
link=`play.php?game=GameTest`,
icon=`img/thumb_gametest.png`,
thumb=`img/thumb_mini_gametest.png`,
swf=`swf/GameTest.swf`,
height=`500`,
width=`920`
WHERE
keyIndex=`GameTest2`";
$query = mysql_query($sql);
if (!$query) exit (mysql_error());
我一直在我的设置变量周围尝试不同的分隔符(大括号、撇号、引号)但无济于事。这里有保留字吗?
更新 [已解决],更正代码:
$sql = 'UPDATE
`GameInformation`
SET
`keyIndex`="GameTest",
`name`="Game Test",
`release`="2012-09-02",
`platforms`="Android",
`link`="play.php?game=GameTest",
`icon`="img/thumb_gametest.png",
`thumb`="img/thumb_mini_gametest.png",
`swf`="swf/GameTest.swf",
`height`="500",
`width`="920"
WHERE
`keyIndex`="GameTest2"';
$query = mysql_query($sql);
if (!$query) exit (mysql_error());