Maybe nl2br is what are you looking for?
Use this:
echo nl2br($result[msg]);
As long as browsers doesn't treat \r\n
as real new-lines - you need to "convert" them to <br>
's with nl2br()
Also you can use:
REPLACE(`col_name`,"\n","<br />") as `col_name`
You must use this after SELECT
.
Example code:
SELECT *, REPLACE(`name`,"\n","<br />") as `name` FROM xyz WHERE id="%s"