29 lines
684 B
PHP
29 lines
684 B
PHP
<?php
|
|
|
|
namespace ppa\Model;
|
|
use ppa\Model\ParticipantModel;
|
|
|
|
class NotesModel extends Database
|
|
{
|
|
public function selectNotes()
|
|
{
|
|
$sortBy = 'updated_at';
|
|
$sortOrder = 'DESC';
|
|
|
|
$sql = "SELECT id, title, content, created_at, updated_at
|
|
FROM notes
|
|
WHERE user_id = 2
|
|
ORDER BY updated_at 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);
|
|
}
|
|
} |