<?
$config = array ('dbhost'=>'localhost',
				 'dbname'=>'admin_mrush',
				 'dbpass'=>'JO8nBf519I',
				 'dbuser'=>'admin_mrush');

$db= new PDO('mysql:host='.$config['dbhost'].';dbname='.$config['dbname'].'', 
				$config['dbuser'], $config['dbpass'],array( PDO:: MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));

$i=0;
$users=$db->prepare("SELECT * FROM `users` WHERE `vip`=?");
$users->execute(array("yes"));
while($us=$users->fetch()){
	if($us['vip_time']<=time()){
		$update=$db->prepare("UPDATE `users` SET `vip`=?,`vip_time`=? WHERE `id`=?");
		$update->execute(array("no",0,$us['id']));
	}
}
?>
