Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

dynamic update to all users

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

dynamic update to all users

Postby msmohan » Sat Nov 17, 2012 12:00 am

Hi All,

I am developing a website that is having some requirement like instant update to all users.

Example:
If my site have 5 viewers rit now, and I am showing the like count when a person click on like button increase count to all other users. if the like count is 10 then someone click the like button I increased the count using ajax to the database to show this update to everybody I called a ajax call for every 5 seconds and checking that is there any likes or not. Am I doing rit? or Is there any other better way to trigger the database affect to all users?

Thanks
msmohan
New php-forum User
New php-forum User
 
Posts: 36
Joined: Sun Jun 05, 2011 9:03 pm

Re: dynamic update to all users

Postby seandisanti » Mon Nov 19, 2012 2:47 pm

You could do it that way, yes. Although personally i'd say if they REALLY need to know the number of likes that often, let them hit F5. Why send so many unnecessary requests through your server instead of just letting the ones that want updates that often refresh it manually?
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 783
Joined: Mon Oct 01, 2012 12:32 pm

Re: dynamic update to all users

Postby msmohan » Tue Nov 20, 2012 1:31 am

Thanks for your reply,

Actually showing like and increasing will give more profit for my client so I guess I need to request it dynamically. and thanks again.
msmohan
New php-forum User
New php-forum User
 
Posts: 36
Joined: Sun Jun 05, 2011 9:03 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.