// Выбор id залогиненного пользователя (по id буду сортироваться сообщения в ленты новостей от пользоватей на которых он подписан ) $sqlForSubscriberByLogged = "SELECT id_request_reciver FROM subscribers WHERE id_request_sender='$loggedUser->id' "; $queryForSubscriberByLogged = $database->query($sqlForSubscriberByLogged); $fetch_arrayForSubscriberByLogged = $database->fetch_array($queryForSubscriberByLogged); // Здесь сортировка для ленты новостей от нужных пользователей на которых подписан залогившейся юзер. // Фильтрация данных будет идти от id_request_reciver $sqlForWallMessagesBySubscribers = "SELECT id_mes,id,text,sender,minute,hour,day,month,year FROM wall_messages WHERE id='$fetch_arrayForSubscriberByLogged[id_request_reciver]' ORDER BY id_mes DESC LIMIT 15"; $queryForWallMessagesBySubscribers = $database->query($sqlForWallMessagesBySubscribers); Need help properly "filter" the output of data for the news feed. That is, I select from the database those fields where my id is subscribed to other users with their id. The problem is that I only get the id of the LAST YEAR for which I have subscribed, but does not give out all (that is, not all the fields, but only one), in the cycle below just goes filtering by messages. 
Here's how it turns out. And I need something like this ... 
Thank you in advance for your help...