This question is an exact duplicate of:
I've a problem to delete in my table mySQL and I don't understand why. If you can help me.
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
include ('config.php');
// Recup the $_POST
$idTournament ='2';
// querys all the participation before to delete the tournament
$request1 = $handler->prepare('DELETE FROM Participate WHERE tournament_id = :idTournament')
//bind the parameters
$request1->bindParam(':idTournament', $idTournament, PDO::PARAM_INT);
//execute the prepared statement
$request1->execute();
?>
However, when I put my console the line "DELETE from ...", it works. So...
Thank you
Mickey74
</div>
you have forgot to put semicolon after prepare statement.
<?php
error_reporting(E_ALL); ini_set('display_errors', 1);
include ('config.php');
// Recup the $_POST
$idTournament ='2';
// querys all the participation before to delete the tournament
$request1 = $handler->prepare('DELETE FROM Participate WHERE tournament_id = :idTournament');
//bind the parameters
$request1->bindParam(':idTournament', $idTournament, PDO::PARAM_INT);
//execute the prepared statement
$request1->execute();
?>