1
我在與網頁難度不會立即顯示更新的數據 這是我目前的一個:PHP腳本,重新加載頁面
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("hospital", $con);
$result = mysql_query("SELECT * FROM t2");
echo"<br>";
echo"<big>All In Patients</big>";
echo "<table border='1'>
<tr>
<th>Pnum</th>
<th>HospNum</th>
<th>RoomNum</th>
<th>LastName</th>
<th>FirstName</th>
<th>MidName</th>
<th>Address</th>
<th>TelNum</th>
<th>Stat</th>
<th>Nurse</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['PNUM'] . "</td>";
echo "<td>" . $row['HOSPNUM'] . "</td>";
echo "<td>" . $row['ROOMNUM'] . "</td>";
echo "<td>" . $row['LASTNAME'] . "</td>";
echo "<td>" . $row['FIRSTNAME'] . "</td>";
echo "<td>" . $row['MIDNAME'] . "</td>";
echo "<td>" . $row['ADDRESS'] . "</td>";
echo "<td>" . $row['TELNUM'] . "</td>";
echo "<td>" . $row['STAT'] . "</td>";
echo "<td>" . $row['NURSE'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
<form>
<input type="button" class='type_button' value="Print" onClick="window.print();" />
</form>
</body>
</html>
你知道什麼解決辦法,可以使上述更新的代碼?因爲當我更新數據,然後加載上面的代碼。它只會顯示尚未更新的先前數據。您必須右鍵單擊並刷新頁面以查看效果。
這是緩存問題嗎? – 2010-03-05 13:03:30
你應該在你的代碼上面執行UPDATE SELECT,那麼它應該工作,如果不是那麼問題是在別的地方 – 2010-03-05 13:04:18
不是緩存問題,我試過了下面的代碼,但不會工作 – user225269 2010-03-05 23:20:26