push current stand

This commit is contained in:
WummerMIB
2025-12-05 08:37:52 +01:00
parent 00bcb5afec
commit 075465e56b
7 changed files with 135 additions and 60 deletions
+21
View File
@@ -80,6 +80,27 @@ class ChatServer implements MessageComponentInterface {
$stmt->close();
$db->close();
}
protected function countUnread($receiverId, $senderId) {
$db = new mysqli("localhost","root","","projekte");
$stmt = $db->prepare("
SELECT COUNT(*)
FROM chat
WHERE user_empfaenger = ?
AND user_sender = ?
AND gelesen = 0
");
$stmt->bind_param("ii", $receiverId, $senderId);
$stmt->execute();
$stmt->bind_result($count);
$stmt->fetch();
$stmt->close();
$db->close();
return $count;
}
}
// Server starten