PHP mySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tommy1987
Forum Commoner
Posts: 92
Joined: Tue Feb 21, 2006 8:35 pm

PHP mySQL

Post by tommy1987 »

I have a form where I have a textarea which I am storing in a mySQL database field (type: text). This includes a large amount of text, and if new lines are typed into the textarea then stored, I want them to be displayed when i display it from the database onto the website, however it just puts all the text together, ignoring newlines and spaces.

Hope someone can help. Thanks in advance.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Can we see some code?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

nl2br() is probably the place to start

Mac
tommy1987
Forum Commoner
Posts: 92
Joined: Tue Feb 21, 2006 8:35 pm

Post by tommy1987 »

The nl2br() function provided just what I was looking for. Is there something to insert   to conserve spaces entered also?

Thanks very much..
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply