开发者

how to count and display realtime database queries using ajax and PHP?

It gives great effect when you stream info in real time using ajax. for this example a SEO / webgrader tool called www.teqpad.com gives a nice interface and real time information on each queries into its database. They use PHP/ajax for the purpose.

My questions are:

  • how do they do it?
  • What are the methods or steps to take care of?
  • How php need to be written in to show the same.

I am not asking 开发者_JAVA技巧code but the method or proceedure to write the same.

Thanks in advance


Use the javascript setTimeout() function to invoke GET requests to the server. Server returns data from your database. HTML is updated.


You do an AJAX call every few seconds with javascript and refresh the HTML of the page with the response of the call.

You could use JQuery to do the AJAX calls: http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/

The call can be done to a PHP script. Depending the kind of information you want to get is the kind of operations you do on PHP.

Here is a simple example: http://www.queness.com/post/328/a-simple-ajax-driven-website-with-jqueryphp

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜