我不断收到此错误:您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'WHERE username = 'username' VALUES ('value')' 附近使用正确的语法。代码应该采用登录用户输入的值表单,然后将该值插入到表的货币列中。
<?php include("auth.php");?>
<?php
if(isset($_POST['submit']))
{
$getmoney = @mysql_query("INSERT INTO players (money) WHERE username =
'".$_SESSION['username']."' VALUES ('$_POST[amount]')")
or die("Error: ".mysql_error());
echo '
<div style="
top: 395;
left: 99;
position: absolute;
z-index: 1;
visibility: show;">
Money Received.
</div>
';
}
?>
</head>
<body>
<p>Bank</p>
Enter amount of money to recieve.<br>
<form action="bank.php" method="post">
<table border=2>
<tr>
<td>Amount to Receive:</td><td><input type="text" name="amount" size="20px"></input>
</td>
</tr>
</table>
<input type="submit" name="submit" value="Get Money"></input>
</form><br><br>
<hr size=2>
<?php include("footer.php");?>
</body>
</html>