Asked By
teo boe
0 points
N/A
Posted on - 01/31/2013
Hi experts,
I am newbie in PHP and developing a web page. I want that my page update automatically when I made changes in the database. I am looking for autoupdate in php. I am finding a way how doing this. Can you provide me a code to help me out? I want that my PHP page always keeps checking the database, If any update available, then entire page should be auto  updated.
I want to my page get autoupdate in PHP
Hay,
If you use window.setInterval() and jQuery's .load() you should be able to do what you want.
The PHP script should return the HTML that needs to replace the previous one.
Javascript:Attached
Another basic example code:Attached
Hope to enjoy it.
Thanking you
Franke Mary
I want to my page get autoupdate in PHP
Hi Teo,
Â
If your database is in MySQL Server then you need to use MySQL Functions that are available to use with PHP code. In all there are 3 API that PHP provides for accessing the data using MySQL. You need to be clear as to which one to use for your script. The PHP API’s are mysql, mysqli, and PDO extensions. All you need is to grab the last modified entry from MySQL database and show it through PHP on your database. It would simply execute the php page using the API and not update the page automatically.
Â
Regards,
Alice