0
Good afternoon. I’m trying to program in php (I’m new), and I created a connection with the bank, but when I try to download a data in my bank through my system, it presents the following error:
Parse error: syntax error, Unexpected ';' in "code path" online 24
But honestly, I can’t identify the mistake:
<?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();
}
?>
$output.=" <p>Added Successfully" . $serial[$key]. ; try to take this point, which is before the ;
– Wictor Chaves
and you’re wearing 2 elses
– Wictor Chaves