Good afternoon. I am trying to program in php (I am newbie), and I created a connection with the bank, but when I try to register a data in my bank through my system, it presents the following error:
Parse error: syntax error, unexpected ';' in "code path" on line 24
But honestly, I can not identify the error:
<?php
$input_quantidade_venda = $_POST['input_quantidade_venda'];
foreach ($input_quantidade_venda as $key => $value) {
$query = "SELECT id_venda FROM vendas WHERE serial = '".mysqli_real_escape_string($serial[$key])."'LIMIT 1";
$resultSet = $mysqli->query($query);
if ($resultSet->num_rows == 0) {
$query = "INSERT INTO vendas(desconto) VALUES('".mysqli_real_escape_string($value)."')";
$insert = $mysqli->query($query);
if (!$insert) {
echo $mysqli->error; //Linha 24 <-
} else {
$output.="<p>Adicionado com Sucesso" .$serial[$key].;
} else {
$output.="<p>Esse dado já existe" .$mysqli->error;
}
}
$mysqli->close();
}
?>