There is a textarea element when reading and sending data through get to save to the database, the newline character is lost.
Code snippets: js
var message=$("#in_message").val(); $.get('chatpost.php?message='+message+); php
$message=htmlspecialchars($_GET['message']); $message=mysql_escape_string($message); The line break character must be present in the database, but it is not. Perhaps this is due to the get request, and it is worth changing the line at the client, for example, message = message.replace(/\n/g, '/n'); but nothing happens either.