projekt templade added
This commit is contained in:
28
Model/GalleryModel.php
Normal file
28
Model/GalleryModel.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace ppa\Model;
|
||||
use ppa\Model\ParticipantModel;
|
||||
|
||||
class GalleryModel extends Database
|
||||
{
|
||||
public function selectPhotos()
|
||||
{
|
||||
$sql = "SELECT title, filename, category.description, firstname, gallery.created
|
||||
, gallery.description as alt
|
||||
FROM gallery
|
||||
JOIN category ON category.id = categoryId
|
||||
JOIN user ON user.id = userId
|
||||
ORDER BY gallery.created DESC";
|
||||
|
||||
$pdo = $this->linkDB();
|
||||
|
||||
try {
|
||||
$res = $pdo->query($sql);
|
||||
} catch (\PDOException $e) {
|
||||
new \ppa\Library\ErrorMsg("Ihre Anfrage konnte nicht verarbeitet werden", $e);
|
||||
die;
|
||||
}
|
||||
|
||||
return $res->fetchAll(\PDO::FETCH_ASSOC);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user