javascript - How can I write a real time stats system? in ajax and php -


I am trying to create a real time statistics bar. And I think about using the Long Polling concept.

But when a request is sent to php, if the statistics are updated then I need to test.

Now I can make a loop with just one database query, and I can test it. But it just does not seem right to me :)

Is there a more inexpensive method to test the database for updates?

It is determined whether the data has been updated or not, on how intensive the query is Will depend. If this is a simple (and quick) query, then this would be the best option. If this is an expensive query, how the statistics are updated, then you either set up a datestamp or trigger the DB for you. No matter, you will need to query some type to check for updates.

And you can not "push" the client from the server, so no matter what you need AJAX polling so that the customer can start the investigation ....

< / Html>

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -