Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/265.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php删除请求错误_Php_Mysql - Fatal编程技术网

Php删除请求错误

Php删除请求错误,php,mysql,Php,Mysql,我的表mySQL中有一个要删除的问题,我不明白为什么。 如果你能帮助我 <?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

我的表mySQL中有一个要删除的问题,我不明白为什么。 如果你能帮助我

<?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();

?>
但是,当我把控制台放在DELETE from…(从…删除)行时,它就工作了。所以

多谢各位


Mickey74

您忘了在prepare语句后加分号

<?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();

?>

您是否收到任何错误?执行后$request1的状态是什么?请尝试使用$request1=$handler->prepare'DELETE FROM particiate WHERE tournament_id='。$idTournament;