我想根据存入金额的输入查询数据库。在数据库中存储了银行的最低金额。所以查询包括显示所有具有 min_amount 的银行
金额定义为$amount,包含最小金额的行是minimum。所以我这样做了,但它告诉我:$amount 的未定义索引。???
<form name="test" method="get" action="this.php">
Amount: <input name="amount"/>
<input type="submit"/>
</form>
<?php
$amount = $_GET["amount"];
$result = mysql_query("SELECT * FROM list1 WHERE minimum <= '$amount'");
while($row = mysql_fetch_array($result))
{
echo $row['bank_name'] . " - " . $row['Tariff'];
echo "<br />";
}
?>