I have a file which is of php type. And I have a combination of HTML elements, javascript functions and some PHP scripts as well. I want to rerun the php script say some part of the script again and again. lets take this example:
<html>
<?php
$connection = mysql_connect('localhost','root','root');
$db = mysql_select_db('messenger');
if ($db == null)
{
echo "hello";
}
$messagecheck = "select * from Messages where destination = '$user' && status = 'ACTIVE'";
$result = mysql_query($messagecheck);
$no_rows = mysql_num_rows($result);
............
?>
<body>
........
<form>
<input type="submit">
.......
</form>
</body>
</html>
I want to run the above php script continuously for every 1 min from the same file. When I make use of location.reload()
I find that complete document gets reloaded. I just want the affect the part of the page which php script accesses and not the whole doc.
How can I do that? Please help.