I have this notification query i want it to be live updated

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aniket
Forum Newbie
Posts: 1
Joined: Sat Oct 03, 2015 8:42 pm

I have this notification query i want it to be live updated

Post by aniket »

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>
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: I have this notification query i want it to be live upda

Post by Christopher »

What specifically is the question? Updated how?
(#10850)
Post Reply