I have this notification query i want it to be live updated
Posted: Sat Oct 03, 2015 8:57 pm
Code: Select all
<?php $sql55= mysql_query("SELECT * FROM notification WHERE
to_user='$userid1' and seen='0'")
while($dn5 = mysql_fetch_array($sql55))
{
?>
<li><div class="menu-icon"><img alt="example image"
src="profile/upload/<?php echo $dn5['from_user_img']; ?>"></div> <a href="cpost.php?id=<?php echo $dn5['msg_id']; ?>"> </a>
<div class="menu-text"><a href="<?php echo $dn5['from_user']; ?>"><?php echo $dn5['from_user']; ?></a> has Commented on Your <a href="cpost.php?id=<?php echo $dn5['msg_id']; ?>">Post </a>
<div class="menu-info"><span class="menu-date"><?php echo timeAgo($dn5['timestamp']);?></span></div>
</div>
</li>
<?php
}
if(intval(mysql_num_rows($sql55))==0)
{ ?>
<tr>
<td colspan="4" class="center">You have no new Notifications.</td>
</tr>
<?php } ?>
<script type="text/javascript">
var autoLoad = setInterval(
function ()
{
$('#load_notification').load('load_notification.php').fadeIn("slow");
}, 10000); // refresh page every 10 seconds
</script>
<body>
<div id="load_notification"></div>
</body>