I am trying to get Ajaz to pull data from mysql using a php file every 5 seconds and the process continues. It seems to work great in firefox but does not update in IE.
Can anyone help make this platform independent?
Ajax/Jquery Code
function startprogress() {
$.get("status.php");
setTimeout('updateStatus()', 500);
}
function updateStatus() {
$("#progress").load("status.php");
setTimeout('updateStatus()', 500);
}
PHP File
mysql_connect("localhost","root","password") or
die("Could not connect: " . mysql_error());
mysql_select_db("table");
$sql="SELECT current, total FROM status WHERE id = 1";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result))
{
echo "Completed: " . $row['current'] ." of " . $row['total'];
}
Then I have an empty div with id of progress in my HTML file where I have the onClick event to trigger the startprogress() function.
Can anyone help with this?
Thanks much.