Hi, I have a problem and I can't figure out why this happen.
Hi have this code, the the firs if it works very well, in the seccond if, this statment
$retirar1 = "UPDATE economia SET saldo = '$valor1' WHERE equipa ='Sporting'";
doesn't work.
if (!empty($lugpe)) {
$query = "UPDATE estadio SET empe = '$total' WHERE equipa ='Sporting'";
$retirar = "UPDATE economia SET saldo = '$valor' WHERE equipa ='Sporting'";
mysql_query( $query, $link )
or die ( "INSERT error: ".mysql_error() );
mysql_query( $retirar, $link )
or die ( "INSERT error: ".mysql_error() );
}
$lugsent = $_POST['lugsent'];
$sentados = $row2['sentados'];
$total2 = $lugsent + $sentados;
$custos1 = $lugpe * 200;
$valor1 = $saldo - $custos1;
if (!empty($lugsent)) {
$query = "UPDATE estadio SET sentados = '$total2' WHERE equipa ='Sporting'";
$retirar1 = "UPDATE economia SET saldo = '$valor1' WHERE equipa ='Sporting'";
mysql_query( $query, $link )
or die ( "INSERT error: ".mysql_error() );
mysql_query( $retirar1, $link )
or die ( "INSERT error: ".mysql_error() );
}
Why?
thanks