<?
$rew1 = qw("SELECT COUNT(*) FROM voyna WHERE vrag='$re1[strana]'");
$row = mysql_fetch_row($rew1);{$total1 = $row[0];}
if($total1>0){
$money = qw("SELECT * FROM voyna  WHERE vrag='$re1[strana]'");
while($array = mysql_fetch_array($money)){
$rew2= mysql_fetch_array(qw("SELECT id FROM gos WHERE strana='$array[strana]'"));
$total=$rew2['id'];
if($total >0){}else{
qw("DELETE FROM voyna WHERE id='$array[id]'");$tm=time();
qw("INSERT INTO mess (komu,kto,data,st,tip,text) VALUES('$re1[strana]','@','$tm','0','0','Гос-во $array[vrag] проиграло!')");
header("Location:game.php?der=$key");
}
}
}
?>