You're producing a vast amount of js with the first script. You need to just provide a general routine. You'll end up running hundreds of routines. Why not produce a script to make a general retrieval every few seconds?
I have to say - every second, may be a bit much - depending on the amount of data you're drawing down. If you get a hundred users on your site at the same time, the load on your DB will be HEAVY.
1. Main php page - include the updatestatus.php file to give the opening set of data.
2. Your interval js will already be placed in document.ready(...) so it starts running as soon as the page has loaded. It just calls ther same data from updatestatus.php and updates that part of the page.
<script>
...
function updatestatus(){
jQuery('#auctions').load('inc/updatestatus.php');
}
setInterval("updatestatus()", 5000);
...
</script>
...
<div id="auctions">
include('inc/updatestatus.php');
</div>
Not tested
diafol
Rhod Gilbert Fan (ardav)
Moderator
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080