Есть запрос PHP: function Wo_GetPromotedPost() { global $wo, $sqlConnect; $year = date("Y"); $type_table = T_POSTS; $logged_user_id = Wo_Secure($wo['user']['user_id']); $query_one = mysqli_query($sqlConnect, "SELECT `id` FROM {$type_table} WHERE `boosted` = '1' AND `user_id` NOT IN (SELECT `blocked` FROM " . T_BLOCKS . " WHERE `blocker` = '{$logged_user_id}') AND `user_id` NOT IN (SELECT `blocker` FROM " . T_BLOCKS . " WHERE `blocked` = '{$logged_user_id}') ORDER BY RAND()"); $fetched_data = mysqli_fetch_assoc($query_one); if (count($fetched_data) > 0) { $post = Wo_PostData($fetched_data['id']); if (is_array($post)) { return $post; } } else { return array(); } } и PHP PHP: <?php $comments = Wo_GetPostComments('popular'); if (count($comments) > 0) { foreach ($comments as $wo['posts_comments']) { ?> При выводе отображается только 1 запись как сделат чтобы отобразилист сразу все записи
PHP: function Wo_GetPromotedPost() { global $wo, $sqlConnect; $year = date("Y"); $type_table = T_POSTS; $logged_user_id = Wo_Secure($wo['user']['user_id']); $query_one = mysqli_query($sqlConnect, "SELECT `id` FROM {$type_table} WHERE `boosted` = '1' AND `user_id` NOT IN (SELECT `blocked` FROM " . T_BLOCKS . " WHERE `blocker` = '{$logged_user_id}') AND `user_id` NOT IN (SELECT `blocker` FROM " . T_BLOCKS . " WHERE `blocked` = '{$logged_user_id}') ORDER BY RAND()"); $fetched_data = mysqli_fetch_assoc($query_one); if (count($fetched_data) > 0) { $post = Wo_PostData($fetched_data['id']); if (is_array($post)) { return $post; } } else { return array(); } } PHP: <?php $comments = Wo_GetPostComments('popular'); if (count($comments) > 0) { foreach ($comments as $wo['posts_comments']) { ?>