From b37d06e2cc0a67d8819773fdf1ba9a56d3884375 Mon Sep 17 00:00:00 2001 From: "K. Nobel" Date: Thu, 19 Jan 2017 11:55:23 +0100 Subject: [PATCH] Updated queries --- website/queries/friendship.php | 5 +++-- website/queries/user.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/website/queries/friendship.php b/website/queries/friendship.php index 14fa6ee..a3a2fb8 100644 --- a/website/queries/friendship.php +++ b/website/queries/friendship.php @@ -2,12 +2,12 @@ require("connect.php"); function selectAllFriends($db, $userID) { - $stmt = $db->prepare(" + $stmt = $GLOBALS["db"]->prepare(" SELECT `username`, IFNULL( `profilepicture`, - 'img/notbad.png' + '../img/notbad.jpg' ) AS profilepicture, `onlinestatus`, `role` @@ -26,5 +26,6 @@ function selectAllFriends($db, $userID) { $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); $stmt->execute(); + return $stmt; } \ No newline at end of file diff --git a/website/queries/user.php b/website/queries/user.php index 659e0d6..de76ff7 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -22,7 +22,7 @@ function selectUser($db, $userID) { `username`, IFNULL( `profilepicture`, - 'img/notbad.png' + '../img/notbad.jpg' ) AS profilepicture, `bio`, `role`, @@ -42,7 +42,7 @@ function selectUser($db, $userID) { } function selectAllUserGroups($db, $userID) { - $stmt = $db->prepare(" + $stmt = $GLOBALS["db"]->prepare(" SELECT `group_page`.`groupID`, `name`, @@ -65,7 +65,7 @@ function selectAllUserGroups($db, $userID) { } function selectAllUserPosts($db, $userID) { - $stmt = $db->prepare(" + $stmt = $GLOBALS["db"]->prepare(" SELECT `postID`, `author`,