get all messages for chat.php