1$(document).ready(function() {
2 // check once in five seconds
3 setInterval(function() {
4 $.get('/script.php', {do: 'new_messages'}, function(response) {
5 if(response == 1) {
6 window.location.reload();
7 }
8 });
9 }, 5000);
10});
11
1$sql = "select * from chat order by id desc limit 15";
2 $result = mysql_query($sql) or die ("An error has occured with in the database.");
3
4