Размер файла: 600B
<?php
include('../../../system/include/settings.inc');//Потключаемся к базе
$req = mysql_query("SELECT * FROM `my_construction`WHERE `type` = 'stones'");
while ($cron = mysql_fetch_array($req)) {
$req = mysql_query("SELECT * FROM `chars` WHERE `nick` = '".$cron['usr']."'");
$usr = mysql_fetch_array($req);
if($cron['usr'] == $usr['nick'])
{
$stones = $usr['stones'] + $cron['earnings'];
mysql_query("UPDATE `chars` SET `stones` = '$stones' WHERE `nick` = '".$cron['usr']."'");
}}
?>