Files
WebDB/website/queries/friendship.php
Lars van Hijfte 6385324b13 The menu now backend supported
It loads the friends and groups of userID 2 by default (only if there is no session userID set
2017-01-17 14:16:17 +01:00

25 lines
508 B
PHP

<?php
function selectAllFriends($db, $userID) {
return $db->query("
SELECT
`user`.`username`,
`user`.`profilepicture`,
`user`.`onlinestatus`,
`user`.`role`
FROM
`user`
INNER JOIN
`friendship`
WHERE
`friendship`.`user1ID` = $userID AND
`friendship`.`user2ID` = `user`.`userID` OR
`friendship`.`user2ID` = $userID AND
`friendship`.`user1ID` = `user`.`userID` AND
`user`.`role` != 3
");
}
?>