Re: textarea new line to mysql database
| From: | PHPScriptor | Date: | Fri, 15 May 2009 14:19:24 +0000 |
| Subject: | Re: textarea new line to mysql database | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292618@lists.php.net to get a copy of this message | ||
Mja, that's not my intention, in that case I also could use nl2br...
Why does this problem exists? And why does it work with <pre>? Is this a PHP
problem or more a HTML problem?
Robert Cummings wrote:
>
> On Fri, 2009-05-15 at 07:03 -0700, PHPScriptor wrote:
>> Hello,
>>
>> How do you guys handle this "problem".
>>
>> Just a form with a textarea. When I use enters in the textarea it's saved
>> to
>> the db like this:
>>
>> database:
>> "first line
>> second line"
>>
>> when I edit the value in the form:
>> "first line
>> second line"
>>
>> when I output the value to html:
>> "first linesecond line" (unless I use nl2br())
>>
>> Is there a way that I could save it to the db that will work for db,
>> output
>> and edit without using any other function like nl2br?
>
> Not to the DB, but it should respect newlines if you wrap it in
> <pre></pre> tags.
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
-----
visit my website at http://www.phpscriptor.com/
http://www.phpscriptor.com/
--
View this message in context: http://www.nabble.com/textarea-new-line-to-mysql-database-tp23560478p23560765.html
Sent from the PHP - General mailing list archive at Nabble.com.