好的我已经停止进入减号但是如何在使用此代码成功进行余额编辑后运行另一个查询或使用标题位置或类似显示页面 -
<?php session_start();
$id = $_SESSION['user_id'];
$update = 1000;
// Connects to your Database
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("messages") or die(mysql_error());
$data = mysql_query("UPDATE users SET balance = balance - $update WHERE (users.id = $id) AND (balance >= $update)")
echo "<a href="010101levup.php">Level Up! </a> <br>"
or die(mysql_error());
echo "<table border cellpadding=3>";
while($info = mysql_fetch_array( $data ))
{
echo "<a href="010101levup.php">Level Up! </a> <br>"
echo "<tr>";
echo "<th>User:</th> <td>".$info['user_name'] . "</td> ";
echo "<th>Balance:</th> <td>".$info['balance'] . " </td></tr>";
}
echo "</table>";
// echo "Balance Is ".$_SESSION['balance'];
echo $row['user_name'] . " " . $row['balance'];
?>
升级链接需要在成功更新余额后运行或显示,如果没有足够的资金则忽略。
这可能吗?