I am trying to bring out the news of those people that the user is subscribed to, but I get porridge. No, everything is output, but the problem is that they are not outputted by ORDER BY id DESC .
I try to output it through ORDER BY id DESC , but it turns out like this: 
I understand what the problem is, but I absolutely do not understand how to solve it and why this happens. while should not give two values at once in $query .
And yet: is it possible to do this using one cycle?
Here is the code itself:
// Выбираем всех пользователей на которых Мы подписаны. $sql = "SELECT * FROM follow WHERE sender='$s_id'"; $sql = mysqli_query($connect,$sql); $row = mysqli_num_rows($sql); if ($row) { while ($row = mysqli_fetch_array($sql,MYSQLI_ASSOC)) { // Получаем их. $target = $row['target']; // Получаем новости, авторы которых пользователи, на которых мы подписаны. // Тут и возникает проблемка. $target почему-то сразу забирается во все поля где он //есть в shots , а не одно. $query = "SELECT * FROM shots WHERE user_id='$target' AND access='1' ORDER BY id DESC "; $query_go = mysqli_query($connect,$query); $row_shot = mysqli_num_rows($query_go); if ($row_shot) { while($row_shot = mysqli_fetch_array($query_go,MYSQLI_ASSOC)) { $title = $row_shot['title']; $image = $row_shot['image']; echo " <div class=\"col-xs-12 col-sm-6 col-md-6 col-lg-4\"> <div class=\"shot\" data-id=\"\"> <div class=\"shot-preview\"> <a class=\"img\" href=\"shot?id=\"> <img src=\"$image\" alt=\"\"> </a> <h5 class=\"title\"> <a href=\"shot-gallery.html\">$title</a> </h5> <a class=\"label\" href=\"page-search.html\">App</a> </div> <div class=\"shot-detail\"> <div class=\"shot-info\"> <a href=\"\"> <img src=\"assets/img/guest3.png\" alt=\"avatar\"> </a> <h6> <a href=\"\">$target</a> </h6> <time datetime=\"2016-02-04 22:30\">2 hours ago</time> </div> <ul class=\"shot-stats\"> <li> <i class=\"fa fa-eye\"></i> <span>1</span> </li> <li> <a href=\"shot?id=\"> <i class=\"fa fa-comments\"></i> <span>1s</span> </a> </li> </ul> </div> </div> </div> "; } } } } 