array(
id => array(0 => 1,0 => 2,0 => 3),
name => array(0 => name1,0 => name2,0 => name3),
var => array(0 => 10, 0 => 20, 0 => 30),
)
mysql_query("UPDATE `page` SET `views` = `views` + '1',status=IF(views>=10,'off','on') WHERE `status` = 'on' AND `id` = '1' and views < 10);
$changed= mysql_affected_rows();
if($changed){
// пускаем
}else{
mysql_query("UPDATE `page` SET `views` = `views` + '1' WHERE `status` = 'on' AND `id` = '1');
// закрыто
}