Reputation: 29
I have two databases. Below is the code that I am using to get information from the first database.
$myrow = mysql_query("SELECT SUM(uploaded) FROM peers",$db);
$sum = mysql_fetch_array($myrow);
$c = $sum[0] / 1000000;
$d = $c / 1000000;
$l = round($d,3);
echo "<p>UP: $l TB</p>";
$myrow1 = mysql_query("SELECT SUM(downloaded) FROM peers",$db);
$sum1 = mysql_fetch_array($myrow1);
$a = $sum1[0] / 1000000;
$b = $a / 1000000;
$k = round($b,3);
echo "<p>DW: $k TB</p>";
I need to add this information to my second database and update it every 10 min with new fresh information from first database. I am using phpmyadmin.
Upvotes: 2
Views: 1783
Reputation: 7025
Your question is very generic so I will try to answer for all scenario You shoud create a process that run every 10 minutes (cron if you use Linux, scheduled task if you use windows)
If you use Linux you can
If you use Windows you can:
Upvotes: 2
Reputation: 1481
Use cron jobs for updating your information in DB.
http://net.tutsplus.com/tutorials/other/scheduling-tasks-with-cron-jobs
Upvotes: 1