Model/ProjectModel.php gelöscht
This commit is contained in:
parent
4ed905762a
commit
05d6dec504
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user