我不断收到此错误:您的SQL语法有错误;请检查与您的MySQL服务器版本相对应的手册,以便在第1行'WHERE username ='username'VALUES('value')'附近使用正确的语法。 代码应该采用登录用户输入的值放入表格中,然后将该值插入表格的钱列中。你的SQL语法有错误;检查
<?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>
什么是执行的确切查询? – Arjan 2012-07-21 06:54:59
由于这是一家“银行”,我认为他需要更新,但要增加当前的“金钱”数量。 – Novak 2012-07-21 06:56:49