SELECT *
FROM (
SELECT `f`.`user_one` AS `id`, `f`.`status` AS `status`, `f`.`accept` AS `accept`
FROM `friends`
WHERE `f`.`user_two` = :userId
UNION SELECT `f`.`user_two` AS `friend`, `f`.`status` AS `status`, `f`.`accept` AS `accept`
FROM `friends`
WHERE `f`.`user_one` = :userId
) AS `f`
JOIN `users` AS `u`
ON `u`.`id` = `f`.`id`
Возвращает FALSE в случае неудачи. В случае успешного выполнения запросов SELECT, SHOW, DESCRIBE или EXPLAIN mysqli_query() вернет объект mysqli_result. Для остальных успешных запросов mysqli_query() вернет TRUE.