是的,我知道另一个(抱歉)该错误在$ statement = $ pdo->准备就绪。我有另一个功能与这个功能非常类似,它使用相同的细节并且有效。所以我错过了什么或....
/*DATA SQL ACCESS*/
$serverNetwork = "REDACTED";
$username = "REDACTED";
$server = "REDACTED";
$password = "REDACTED";
$pdo = new PDO($server,$username,$password);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
function removeResultFromDB($userID, $term){
global $pdo;
try{
$statement = $pdo->prepare("DELETE FROM `ValidSearchResults` WHERE userID = ? AND searchTerm = ?");
$statemtnt->execute([$userID, $term]);
} catch (PDOException $e){
$statement->error = $e->getMessage();
var_dump($e);
}
}
?>