linkDB(); $params = array(); $sql = "INSERT INTO Filter (kid, iid) VALUES (:kid, :iid)"; $params[":kid"] = $data["kid"]; $params[":iid"] = $data["iid"]; try { $stmt = $pdo->prepare($sql); $stmt->execute($params); } catch (\PDOException $e) { echo $sql; return false; } return true; } public function deleteFilter($id) { $pdo = $this->linkDB(); $params = array(); $sql = "DELETE FROM Filter WHERE id = :id"; $params[":id"] = $id; try { $stmt = $pdo->prepare($sql); $stmt->execute($params); } catch (\PDOException $e) { echo $sql; return false; } return true; } }