Bunu yapmak için nasıl SO 3 mesajlarını okumak, ama nedense çalışmıyor değil.
Sayfa index.php, ben bu komut dosyası var:
<script type="text/javascript">
function update() {
$.get("index.php", function(data) {
$("#uploadcount").html(data);
window.setTimeout(update, 5000);
});
}
</script>
ve daha sonra bu index.php de, div
<div id=uploadcount>
<?
$result = mysql_query("SELECT * FROM mydb");
$num_rows = mysql_num_rows($result);
echo "<h1>$num_rows</h1><h2>rows</h2>";
?>
</div>
The php is displaying the row count fine, but it wont refresh the number.
(i have latest jquery build included in head of index.php)