Нужно чтоб при нехватке выводио ошибку. А оно выводит даже при достаточном колтчестве.
<?
case "kompl4":
$almaz = 4;
if ($tro13 > 0 && $tro14 > 0 && $tro15 > 0 && $tro16 > 0){
mysql_query("UPDATE
`users` SET
`almaz` = '$udata[almaz]'+'$almaz'
WHERE `usr` = '$log'"
or die (mysql_error());
$trof13 = mysql_query("SELECT * FROM `res_trof` WHERE `usr`= '$log' and `lat_name`= '13' and `kol`>='1'"
or die (mysql_error());
$tro13 = mysql_fetch_array($trof13);
$kol = $tro13[kol]-1;
mysql_query("UPDATE `res_trof` SET `kol` = '$kol' WHERE `usr` = '$log' and `lat_name`= '13'"
;
$trof14 = mysql_query("SELECT * FROM `res_trof` WHERE `usr`= '$log' and `lat_name`= '14' and `kol`>='1'"
or die (mysql_error());
$tro14 = mysql_fetch_array($trof14);
$kolw = $tro14[kol]-1;
mysql_query("UPDATE `res_trof` SET `kol` = '$kolw' WHERE `usr` = '$log' and `lat_name`= '14'"
;
$trof15 = mysql_query("SELECT * FROM `res_trof` WHERE `usr`= '$log' and `lat_name`= '15' and `kol`>='1'"
or die (mysql_error());
$tro15 = mysql_fetch_array($trof15);
$kolu = $tro15[kol]-1;
mysql_query("UPDATE `res_trof` SET `kol` = '$kolu' WHERE `usr` = '$log' and `lat_name`= '15'"
;
$trof16 = mysql_query("SELECT * FROM `res_trof` WHERE `usr`= '$log' and `lat_name`= '16' and `kol`>='1'"
or die (mysql_error());
$tro16 = mysql_fetch_array($trof16);
$kole = $tro16[kol]-1;
mysql_query("UPDATE `res_trof` SET `kol` = '$kole' WHERE `usr` = '$log' and `lat_name`= '16'"
;
echo"<font color='#71cc71'>Комплект успешно обменян!!</font></br><a href=\"trofei.php?\">К трофеям</a>";
}else{
echo"Не весь комплект!";
}
break;
?>
Добавлено 06.12.14 в 08:58:09:
разобрался!