WHILE loop

180
.
I do not know why this statement only fetching only one result

public function Notify()
{
    $req = $this->db->query("SELECT * FROM `notification` WHERE `user_id` = '" . $this->systemUser->id . "' ORDER BY (`read` = '0' AND `time`) DESC");
    if ($req->rowCount()) {
        $i = 0;
        $notify = '';

        while ($res = $req->fetch()) {
            $notify = '<div class="noto-entry">
									<div class="noto-content clearfix">
									<div class="noto-img">
											<a href="../profile/id=' . $res['peer_id'] . '">
												<img src="../img/c1.png" alt="" class="be-ava-comment">
											</a>
										</div>
										<div class="noto-text">
											<div class="noto-text-top">
												<span class="noto-name"><a href="../profile/id=' . $res['peer_id'] . '">' . $res['title'] . '</a></span>
												<span class="noto-date"><i class="fa fa-clock-o"></i> ' . $this->tools->displayDate($res['time']) . '</span>
											</div>
											<a href="../' . $res['peer_link'] . '" class="noto-message">' . $res['text'] . '</a>
										</div>
										</div>
										</div>';
            ++$i;
        }
        return $notify;
    }
    return false;
}
.
Добавлено: 19.05.2017 / 05:15
$req = $this->db->query("SELECT * FROM `notification` WHERE `user_id` = '" . $this->systemUser->id . "'
AND `read` = '0' ORDER BY `time` DESC ");
if ($req->rowCount()) {
$i = 0;
$notify = '';

while ($res = $req->fetch()) {
$notify .= '<div class="noto-entry"> /// dot!

Добавлено: 19.05.2017 / 05:19
http://php.net/manual/en/langu ... g.php
.
OH, sorry I was unaware about that.
I know the syntax but I am very careless
Всего: 3