此代码转到“Else”,我得到“字段列表中的列'服务器'不明确”
$otoon = mysql_real_escape_string($_POST['otoon']);
$oserver = mysql_real_escape_string($_POST['oserver']);
$server = mysql_real_escape_string($_POST['server']);
$sql="UPDATE regusers_test
INNER JOIN alt_toon_test ON (alt_toon_test.toonname = regusers_test.toonname)
SET server='$server'
WHERE username='$user' AND server='$oserver' AND toonname='$otoon'";
if (!empty($server)) {
if (mysql_query($sql,$con)) {
echo "Server updated to: " . $server;
} else {
echo "<h1>Error</h1>";
}
mysql_close($con);
我什至尝试将 $sql 更改为
$gql="UPDATE regusers_test, alt_toon_test SET server='$server' WHERE username='$user' AND server='$oserver' AND toonname='$otoon'";
但我仍然得到同样的错误。我在这里用头撞墙。我知道是什么导致了错误。我有 2 个同名字段。我只是不知道如何克服这一点。