Auto Refresh Table on database update.
Auto Refresh Table on database update.
Hi,
i`m using this example :
[code]<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("sample", $con);
$result = mysql_query("SELECT * FROM countries");
?>
<!DOCTYPE html>
DataTables
@import "media/css/demo_table_jui.css";
@import "media/themes/smoothness/jquery-ui-1.8.4.custom.css";
*{
font-family: arial;
}
$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})
Country
Population
Internet Users
Penetration (% Population)
World % Users
<?php
while ($row = mysql_fetch_array($result)) {
?>
<?=$row['name']?>
<?=$row['population']?>
<?=$row['internet_users']?>
<?=$row['penetration']?>
<?=$row['world_users']?>
<?php
}
?>
[/code]
i`m new to datatable so i`m asking here.
i want to update my table if there is new data on DB without refreshing page.
what i need to use? there is a build in script?
thanks!
i`m using this example :
[code]<?php
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
mysql_select_db("sample", $con);
$result = mysql_query("SELECT * FROM countries");
?>
<!DOCTYPE html>
DataTables
@import "media/css/demo_table_jui.css";
@import "media/themes/smoothness/jquery-ui-1.8.4.custom.css";
*{
font-family: arial;
}
$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})
Country
Population
Internet Users
Penetration (% Population)
World % Users
<?php
while ($row = mysql_fetch_array($result)) {
?>
<?=$row['name']?>
<?=$row['population']?>
<?=$row['internet_users']?>
<?=$row['penetration']?>
<?=$row['world_users']?>
<?php
}
?>
[/code]
i`m new to datatable so i`m asking here.
i want to update my table if there is new data on DB without refreshing page.
what i need to use? there is a build in script?
thanks!
This discussion has been closed.
Replies
thx
without a page refresh (effectivley polling the server), what you are looking for is a 'push' to the client. you could look at comet technology, or silverlight, or knockout perhaps...