mt_rand if mt_rand if text Вы нашли ключ mysql_query INSERT INTO kolho

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$a = mt_rand(1,3);
if($a == 3){
$b = mt_rand(1,3);
if($b == 1){
$text = 'Вы нашли ключ';
mysql_query("INSERT INTO `kolhoz_box` SET `id_user` = '$ku[id]', `key` = '1', `time` = '".($time+60*60*24*3)."'");
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$ku[id]', `id_kont` = '0', `msg` = '".$text."', `time` = '".time()."', `type` = 'to'");
}else{
$text= 'Вы нашли сундук';
mysql_query("INSERT INTO `kolhoz_box` SET `id_user` = '$ku[id]', `time` = '".($time+60*60*24*3)."'");
mysql_query("INSERT INTO `kolhoz_mail` SET `id_user` = '$ku[id]', `id_kont` = '0', `msg` = '".$text."', `time` = '".time()."', `type` = 'to'");
}
}