Can someone lead me down the right way to make a live notifications
e.g Knowing when a new Row in Added in Mysql
know if a php file has changed ???
how should i go about it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could routinely check the server for updates using
setInterval(), or you could employ long-polling with javascript. The benefit ofsetInterval()is that it doesn’t keep connections opened on your server for too long, but you may have updates during the ‘downtime’ between server-calls. Long-polling will give you near-instant updates, as it waits with the connection opened until it receives new information. But obviously, the down side is that you’ve got connections staying opened all over the place.Routine Checks…
Long Polling with PHP/jQuery Example:
You can find an example of long polling with PHP and jQuery at http://blog.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/