Jump to content

Live page updates


blmg2009

Recommended Posts

Hi there I'm a little bit of a newbie when it comes to PHP, and I have tried to find my answer on google and on other websites related to php development. 

 

My question is what do I need to be researching / learning to automatically update a page with content. 

 

For example, if I have a database field called breaking news and this text string is flashed at the bottom of the screen on a scrolling bar.

 

When the field changes value in MYSQL, I would like the page to automatically update the page without a need for a page refresh.

 

All I need is some advice on what I need to search for in order for me to learn the coding myself.

 

I'm thinking AJAX, but not too sure. 

 

Thank you for reading.  

Link to comment
https://forums.phpfreaks.com/topic/291386-live-page-updates/
Share on other sites

There are various techniques to implement this. The easiest way is to update the page every n seconds using Ajax. For example, every 5 seconds you would fetch the current text from the server and insert it into the page.

 

It's also possible to actively push the new content to the client, but this is harder to implement and comes with various issues, so it's not recommended unless you specifically need “real time” updates.

Link to comment
https://forums.phpfreaks.com/topic/291386-live-page-updates/#findComment-1492502
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.