[PHP-DB] Re: new lines in text field From: Hugh Bothwell (hugh_bothwell <email protected>)
Date: 07/30/01

"Kenn Murrah" <warden <email protected>> wrote in message
news:NDBBIGIIILNKOAGPCFEAKEDOHEAA.warden <email protected>
> I'm trying to concatenate several values entered in my form, then write
them
> to a TEXT field in my mySQL database. All is well, except that I want to
> each value to appear on a different line. I've tried \n and that didn't
> work. What am I doing wrong?

You skipped a step here, between "write it to my database" and
"appear on a different line".

I assume that you insert to the database, then pull it out and
display it as HTML. '\n' doesn't cause a line-break in HTML.

You can either use "<br>" instead of "\n" before putting it in
the database (less portable), or look at the nl2br() function
(I would prefer this option, personally).

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>