Model/ProjectModel.php gelöscht

This commit is contained in:
Mohammad Reda Mohammad 2025-09-05 12:07:49 +02:00
parent 4ed905762a
commit 05d6dec504

View File

@ -1,49 +0,0 @@
<?php
namespace ppb\Model;
use ppb\Library\Msg;
class ProjectModel extends Database
{
public function readProject()
{
$pdo = $this->linkDB();
$sql = "SELECT * FROM users";
try {
$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
} catch (\PDOException $e) {
new Msg(true, null, $e);
}
$sth = $pdo->prepare($sql);
$sth->execute();
$result = $sth->fetchAll(\PDO::FETCH_ASSOC);
$sth->closeCursor();
$pdo = null;
// fetch all
return $result;
}
public function insertNewMediaType($data)
{
$pdo = $this->linkDB();
try {
// it should add an new type and it is Files
$sql = "INSERT INTO media_types (id, type)
VALUES (:id, :type)";
$sth = $pdo->prepare($sql);
$sth-> execute([
':id' => $this->createUUID(),
':type' => $data['Files']
]);
$pdo = null;
new Msg(false, "Medientyp erfolgreich eingefügt.");
} catch (\PDOException $e) {
new Msg(true, 'Fehler beim Einfügen des Medientyps', $e);
}
}
}