Re: textarea new line to mysql database
| From: | Robert Cummings | Date: | Fri, 15 May 2009 15:19:45 +0000 |
| Subject: | Re: textarea new line to mysql database | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292632@lists.php.net to get a copy of this message | ||
On Fri, 2009-05-15 at 10:54 -0400, tedd wrote:
> At 7:22 AM -0700 5/15/09, PHPScriptor wrote:
> >Well, the problem is that I have a lot of forms, a lot of data to output, and
> >even then, I don't know always where I have a textarea or just a inputfield.
> >But true, I could even set the nl2br on an input field, it wouldn't make a
> >difference.
> >But I just don't understand why this problem exists? What's the reason?
>
>
> Simply, the problem deals with how different systems handle the "end
> of line" (EOL) character?
>
> You can read more about it here:
>
> http://en.wikipedia.org/wiki/Newline
>
> What you've encountered (IMO) is just another extension/example of the problem.
>
> Now, your choices are to:
>
> 1. Listen to Rob (the wisest) and use the <pre> tag.
>
> 2. Listen to Stuart (the wisest) and use the nl2br() function
>
> 3. Listen to Sterex (IMO -- who is totally wrong) and put html in
> your database;
>
> 4. Or, listen to me (who is somewhere between Rob/Stuart and Sterex)
> and use either the <pre> tag or the nlbr() function depending upon
> what you want to do with the output. Both solutions [1 and 2] provide
> different ways to handle data. Number [3] simply creates another
> problem you, or someone else, will have to deal with later on.
Actually, after reading the other posts with respect to what he's trying
to do, I would use nl2br() unless I specifically needed <pre></pre>.
Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP