开发者

storing MySQL results in XML files and auto refreshing

开发者 https://www.devze.com 2023-01-29 13:14 出处:网络
I have a MySQL database that is being updated pretty regularly. I have found out how to to use PHP to put output the database in XML format but i dont think it is really what I want.

I have a MySQL database that is being updated pretty regularly. I have found out how to to use PHP to put output the database in XML format but i dont think it is really what I want.

I want to end up with an XML file hosted online that refreshes itself every 5 minutes or so with the contents of the MySQL database (could possibly be a very large databa开发者_运维知识库se).

I know that I could simply use MySQL and export it as XML but that would require me sitting there and doing that over and over again.

does anyone know of a good way of going about this?


If you have access to the server you can create a schedule operation that runs every 5 minutes. With a linux server you would use cron.

#MIN HOUR DAYOFMONTH MONTH DAYOFWEEK COMMAND
*/5    *       *       *      *      /home/adam/script.php

The script.php file will create the xml file and store where ever you like.


Use javascript that makes a call to the server every 5 minutes. Either use AJAX if you are more familiar with it or just have it reload the page if you are less familiar with it.

0

精彩评论

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

关注公众号