I'm trying to do a inner join in a update, but it show an error message which is :
"Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error'"
BUT the sql query works ! it updates correctly my field in my database...
So I don't know where the problem is...
Here are my tables : https://ibb.co/jZ7W3q7 and https://ibb.co/QnQMXx8
Here's my code :
// update ticket stock :
foreach($test = $bdd->query('UPDATE ticket INNER JOIN chosen_ticket ON
ticket.id_ticket = chosen_ticket.id_ticket SET ticket.stock = ticket.stock - 1
WHERE chosen_ticket.id_reservation = "'. $_SESSION['idReservation'] .'"') as
$updateTicket){
}