<?
include 'system.php';
$manka = mysql_query("SELECT id,mana,max_mana from `user` order by `id` desc");
while($m = mysql_fetch_assoc($manka)){
if($m['mana'] + 0 > $m['max_mana']){
mysql_query("UPDATE `user` set `mana` = '".$m['max_mana']."' where `id` = '".$m['id']."'");
}else{
mysql_query("UPDATE `user` set `mana` = `mana` + '0' where `id` = '".$m['id']."'");
}
}
?>