我在my table中删除了一个问题,我不明白为什么。 如果你能帮助我。
<?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();
?>
然而,当我把我的控制台放在“从...中删除”这一行时,它就可以了。所以......
谢谢
Mickey74
答案 0 :(得分:0)
您忘记在准备语句后加分号。
<?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();
?>