Yes I know another one (sorry) The error is on the line $statement = $pdo->prepare. I have another function pretty much similar to this one which uses the same details and that works. So am I missing something or....
/*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);
}
}
?>