chat is done?

This commit is contained in:
Lars van Hijfte
2017-01-18 15:09:52 +01:00
parent 19f525d168
commit 95fd3c0040
5 changed files with 84 additions and 34 deletions

View File

@@ -3,6 +3,7 @@
function selectAllFriends($db, $userID) {
return $db->query("
SELECT
`user`.`userID`,
`user`.`username`,
`user`.`profilepicture`,
`user`.`onlinestatus`,

View File

@@ -6,7 +6,7 @@ session_start();
function getOldChatMessages($user2ID) {
$db = $GLOBALS["db"];
$user1ID = 2;
$user1ID = $_SESSION["userID"];
$stmt = $db->prepare("
SELECT
@@ -49,7 +49,7 @@ function sendMessage($destination, $content) {
");
return $stmt->execute(array(
"origin" => 2,
"origin" => $_SESSION["userID"],
"destination" => $destination,
"content" => $content
));
@@ -57,7 +57,7 @@ function sendMessage($destination, $content) {
function getNewChatMessages($lastID, $destination) {
$db = $GLOBALS["db"];
$origin = 2;
$origin = $_SESSION["userID"];
$stmt = $db->prepare("
SELECT