I have a page in which I have one query and a resultant if statement to print one of two gifs. What I would like to do is to reload this query every 60 seconds to check to see if the condition has changed.
I know I can do this with a META refresh, but there are a bunch of other gifs on that page which I would like to avoid reloading.
Here is the code snippet, which is part of an onsite messaging system. It does currently function correctly.
<?php
$msgchk= mysql_query("SELECT * FROM msgs where to_userid='$cookie[0]'");
$waiting_messages = mysql_num_rows($msgchk);
if ($waiting_messages==0) {
echo("<td width=\"73\"><a href=\"view.php\" target=\"SpeakEZBody\" onMouseOut=\"MM_swapImgRestore()\" onMouseO
ver=\"MM_swapImage('messages','','images/btn04_messages_nomsg_on.gif',1)\"><img name=\"messages\" border=\"0\" src=\"image
s/btn04_messages_nomsg.gif\"></a></td>\n");
} else {
echo("<td width=\"73\"><a href=\"view.php\" target=\"SpeakEZBody\" onMouseOut=\"MM_swapImgRestore()\" onMouseO
ver=\"MM_swapImage('messages','','images/btn04_messages_msg_on.gif',1)\"><img name=\"messages\" border=\"0\" src=\"images/
btn04_messages_msg.gif\"></a></td>\n");
}
?>