push current stand
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user