<?
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'] + 50 > $m['max_mana']){
mysql_query("UPDATE `user` set `mana` = '".$m['max_mana']."' where `id` = '".$m['id']."'");
}else{
mysql_query("UPDATE `user` set `mana` = `mana` + '50' where `id` = '".$m['id']."'");
}
}
?>