如标题所述;
TOTAL
? 和
TOTAL
并且当前TOTAL
(在mysql中)超过500k时,会弹出一条警告BUDGET EXCEEDED
谢谢!
CODE:
<?php
require ("config.php");
$link = mysqli_connect($h,$u,$p,$db)
OR die(mysqli_error());
$query = "select BIL, HOTEL, TOTAL, address from HOTELS"
OR DIE(mysqli_error());
$result = mysqli_query($link,$query);
echo "<table border=2>";
echo "<tr><th><b>HOTEL</th><th><b>TOTAL(RM)</th><th>ADDRESS</th></tr>";
while ($row = mysqli_fetch_array($result)) {
echo "<tr><td>$row[HOTEL]</td>";
echo "<td>RM $row[TOTAL]</td>";
echo "<td>$row[address]</td>";
echo "<td><a href='delete.php?del=$row[BIL] '>Delete</a></td>";
echo "<td><input name='checkbox[]' type='checkbox' value='{$row['HOTEL']}'></td></tr>" ;
}
?>
答案 0 :(得分:-1)
使用JavaScript或JQuery(JS库)。
每当选中/取消选中复选框时,从相应的“总计”单元格中检索值
$selected_val = $(this).parent.(".total").text //sample in jquery,
并删除'RM'字样。然后+/-总值。