gpt4 book ai didi

php删除请求错误

转载 作者:行者123 更新时间:2023-11-29 22:44:03 26 4
gpt4 key购买 nike

我在删除表 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();

?>

但是,当我将控制台置于“从...删除”行时,它就可以工作。所以...

谢谢

米奇74

最佳答案

您忘记在 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();

?>

关于php删除请求错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29207519/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com