Hi Everyone, I have got a DIV that I need to refresh, its content consists of an image that will change on the insertion of a row to the SQL Database, however, when I use a refresh on my div it does refresh but does not change the image...
My refresh code is ajax:
<script>
var auto_refresh = setInterval(
function ()
{
$('#update').fadeIn("slow");
}, 60000); // refresh every 10000 milliseconds</script>
and my PHP code contains the MYSQL that has a mysql_num_rows, so that PHP can see if there are rows or not.
<div id="update">
<?
$gathercalls = mysql_query("SELECT * FROM `contact` WHERE `status`='open' AND `staff`='moderator' OR `status`='open' AND `staff`='admin'");
$gcalls = mysql_fetch_array($gathercalls);
$gcall = mysql_num_rows($gathercalls);
}
if($gcall >=1){ ?>
<img src="images/new.gif" align="right" border="0">
<? }else{ ?>
<img src="images/normal.gif" align="right" border="0">
</div>
<? } ?>
I would like my page not to redirect or refresh on my div change.. So I would just like my div to refresh, any help would be appreciated.
Thank you in advance