View Single Post

(#1 (permalink))
Old
futurejp futurejp is offline
Junior Member
futurejp is on a distinguished road
 
Posts: 10
Join Date: Jun 2008
Default Formatting of text retrieved from database - 07-16-2008, 04:19 AM

Hey.

I have a little form on a website where a person enters his/her name in one box, posts text in the second, and presses submit. Then the page refreshes, this data is entered into a table in my database, and then the data is retrieved back and posted on the page. Here's the problem.

Say the text the person entered in is:


"Hi! I know these composers:

Bach
Mozart

and these bands:

The Rolling Stones
Phish"


This text is inserted into my table this way, but when I retrieve it and post it, all text formatting is gone. So it looks like:

"Hi! I know these composers:Bach Mozart and these bands: The Rolling Stones Phish"

Or something like that. Essentially, extra spaces, line breaks, and things like that aren't kept. How can I fix this? Is it just as simple as changing the Field Type in my table? Right now, the type is just 'TEXT.' Or if not, what can I do?

Thanks
Reply With Quote