Файл: cron/podarok.php
Строк: 12
<?php
@include('db.php');
$q1=mysql_query("SELECT * FROM `users` WHERE `podarok`='no'");
while($q2=mysql_fetch_assoc($q1)){
mysql_query("UPDATE `users` SET `podarok`='no1' WHERE `id`='$q2[id]'");
}
$s1=mysql_query("SELECT * FROM `users` WHERE `podarok`='yes'");
while($s2=mysql_fetch_assoc($s1)){
mysql_query("UPDATE `users` SET `podarok`='no' WHERE `id`='$s2[id]'");
}
$a1=mysql_query("SELECT * FROM `users` WHERE `podarok`='no1'");
while($a2=mysql_fetch_assoc($a1)){
mysql_query("UPDATE `podarok` SET `day1`='no',`day2`='no',`day3`='no',`day4`='no',`day5`='no' WHERE `id_us`='$a2[id]'");
mysql_query("UPDATE `users` SET `podarok`='no' WHERE `id`='$a2[id]'");
}
?>