<?
$q=mysql_query("SELECT * FROM `kolhoz_petground` WHERE `id_user` = '$ku[id]' AND `id_pet` != '0'");
while($post=mysql_fetch_array($q))
{
if($post['time']>=$time)
{
$nt=$time-$post['last_rf'];
}
else
{
$nt=$post['time']-$post['last_rf'];
}
if($nt<0)$nt=0;
mysql_query("UPDATE `kolhoz_petground` SET `time_money2` = '".($post['time_money2']+$nt)."', `last_rf` = '$time' WHERE `id` = '$post[id]'");
}
?>