I am trying to add text from a textarea on my site into a MySQL database.
Below is the PHP code that is adding the text to the database.
if (isset($_
Your text, unless you're using a rich-text editor, such as Mark-down (as here on Stackoverflow), is styled by your CSS, not by the contents of the textarea
itself.
If the problem is preservation of new-lines, then you could run the string through the nl2br($text) function before storing in, or retrieving from, the database.
I'd suggest on retrieval would be better, but that's just my opinion (and I can't offer any evidence to back it up).
Or you can use
echo nl2br($test);