Обработка ошибок
This commit is contained in:
parent
0bb76777eb
commit
7c7e4295e9
@ -11,7 +11,14 @@ class PresentsModel
|
|||||||
|
|
||||||
public function __construct(int $user_id)
|
public function __construct(int $user_id)
|
||||||
{
|
{
|
||||||
|
if (!$this->DB) {
|
||||||
|
try {
|
||||||
$this->DB = db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
$this->DB = db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo "Такого пользователя не существует!";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAllPresents()
|
public function getAllPresents()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user