-2

I am using PHP to handle my html forms and a MySQL database to store the data. Users can upload posts on my web app with only one problem. If they use "returns" in the textarea it doesn't come back from the database that way. What can I do so that I store the "returns"?

Example

User Input:

This is a 
string.

Output from the database:

This is a string.

I want the output to match the input.

1 Answers1

4

A textarea uses newlines instead of BR's

If you are using PHP, try using 'nl2br()', this converts all the newlines in a textarea to BR's which should fix your content.

EDIT

Use this on your Database output.

SidOfc
  • 4,552
  • 3
  • 27
  • 50