VPR_Schnittstelle/Model/FilterModel.php

52 lines
1016 B
PHP
Raw Permalink Normal View History

2024-01-14 23:25:25 +01:00
<?php
namespace ppb\Model;
use ppb\Model\Database;
//Erstellt durch Stefan Groß - Samuel Wolff
class FilterModel extends Database
{
public function insertFilter($data)
{
$pdo = $this->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;
}
}