0

I do not understand why I am getting an error in the code below

unexpected ';' C:\xampp...on line 18

if($stmt = $conn->prepare('INSERT INTO facturas (id_factura, id_depositante, beneficiario, endereço, cell, descriçao, montante) VALUES (?, ?, ?, ?, ?, ?, ?)'){
  $stmt->bind_param('ssssisi', $id_factura, $nome, $_POST['beneficiario'], 
  $_POST['endereço'], $_POST['cell'], $_POST['descriçao'], $_POST['montante']); //here is the line 18
  $stmt->execute();
}

It seems like it was not expecting the end of the $stmt->bind_param line.

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • 4
    Your if-statement is has two opening parenthesis, but only one closing one. `if(...prepare(...){` – Ivar Jun 09 '20 at 11:27
  • You need to stop manually checking for errors. Please read: [Should we ever check for mysqli_connect() errors manually?](https://stackoverflow.com/q/58808332/1839439) and [Should I manually check for errors when calling “mysqli_stmt_prepare”?](https://stackoverflow.com/q/62216426/1839439) – Dharman Jun 09 '20 at 11:27

0 Answers0