<?php
###Каждый час
include 'core/sys.php';
$rand_anek = mysql_fetch_assoc(mysql_query("SELECT `text` FROM `anek` ORDER BY RAND() LIMIT 1"));
echo $rand_anek['text'];
#$veselun = mysql_fetch_assoc(mysql_query("SELECT `health`,`max_health` FROM `users` WHERE `id`='2'"));
mysql_query("UPDATE `users` SET `health`='100000' WHERE `id`='2'");
$arena_test = mysql_result(mysql_query("SELECT COUNT(id) FROM `arena` WHERE `user_id`='2'"),0);
if($arena_test == 0){
mysql_query("INSERT INTO `arena` SET `user_id`='2',
`ank_id`='0',
`time`='".time()."',
`level`='3'");

}
mysql_query("INSERT INTO `chat` SET `user_id`='2',
`text`='".$rand_anek['text']."',
`time`='".time()."'");

?>