Auto Refresh Table on database update.

Auto Refresh Table on database update.

ofirattiaofirattia Posts: 3Questions: 0Answers: 0
edited February 2013 in General
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!

Replies

  • jodijodi Posts: 2Questions: 0Answers: 0
    admin,answer pleasee....

    thx
  • FredFlintstoneFredFlintstone Posts: 24Questions: 0Answers: 0
    edited April 2013
    there is no simple way to do that. it all depends on what server technology you are using and has nothing to do with datatables (if i understand you).

    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...
This discussion has been closed.