try something like
Code:while(true) { $totalonline = mysql_fetch_array($online); echo "Players online: " .$totalonline['currentlyonline'].""; sleep(5); }
|
|

try something like
Code:while(true) { $totalonline = mysql_fetch_array($online); echo "Players online: " .$totalonline['currentlyonline'].""; sleep(5); }

oh my bad, i don't actually know php very well either p:
although i would put the sleep after the echo part
u mean you want it to update users online every5 seconds instead of having to refresh? if so you could put the output page of that script into a iframe and put a refresh on the iframe so it refreshes every 5 seconds, just a non php method

Code:<div id="players"> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script> setInterval(function() { $("#players").load('your_file.php'); }, 5000); </script>

| « Free webdevelopment services (I KEEP IT UP-TO-DATE WITH PICS/DEMO'S!) *READ* [FREE] | [[Hiring]] WebClient and/or Webpage Designer » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |