query('SELECT * FROM users WHERE id = "?s" OR login = "?s"', $user, $user)->fetch_assoc(); foreach ($this as $key => $value) { if (isset($user_query[$key])) { $this->$key = $user_query[$key]; } } } public function showPresents() { //$presents = db::c()->query('SELECT img, sender FROM `users_presents` WHERE expiration_date >= "?s" AND owner = ?i', date('Y-m-d'), $user->id); $presents_query = db::c()->query(); if ($presents_query->getNumRows()) { echo << Подарки PRESENT_BEFORE; while ($row = $presents_query->fetch_assoc()) { echo << PRESENT; } echo << PRESENT_AFTER; } } public function showUserInfo() { $dressed_items = db::c()->query('SELECT * FROM inventory WHERE owner_id = ?i' AND dressed_slot > 0, $this->id); foreach ($dressed_items->fetch_assoc() as $item) { } } }