Jump to content

Ajax refresh code every 5 seconds


Freid001

Recommended Posts

Ok so I have a PHP code below. How can I use Ajax to refresh this code every 5 seconds with out a page refresh?

Any help would be great!

 

Thanks  :D

--------------------------------------------------------------------------------------------

 

<?php

 

$host= XXXX

$mysql_user =  XXXX

$mysql_password =  XXXX

$mysql_database =  XXXX

;$username = $test;

 

$connection =  XXXX

 

$query = mysql_query("SELECT * FROM Game WHERE user='$username'");

$numrows = mysql_num_rows($query);

while ($row = mysql_fetch_assoc($query))

{

$Comment = $row['Comment'];

}

 

echo "$Comment";

 

?>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/222213-ajax-refresh-code-every-5-seconds/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.