Re: textarea new line to mysql database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@Robert:
True. I was assuming that the text was going to be final and not being
edited again.

@PHPScriptor:
If you do have a lot of textareas to work around with, why don't you give
TinyMCE a try. Thats the best option you have got. It replaces the textarea
into more of a html compatible one and when you are editing the text again,
it will be properly formatted.

You'll also get toolbars for text editing etc., more like your mail compose
window right now. :)

-Sterex

On Fri, May 15, 2009 at 7:56 PM, Robert Cummings <robert@xxxxxxxxxxxxx>wrote:

> On Fri, 2009-05-15 at 19:48 +0530, Manoj Sterex wrote:
> > Well, instead of storing the text from the textarea directly into the db,
> > validate it and wrap it with <br /> tags (replace \n) and then store it.
> > This way you needn't use nl2br every time you retrieve the text from db.
>
> Don't do that unless it's a cached entry in the DB. Unless you
> absolutely know you'll never need the raw text again, you should always
> store the raw text so it can be processed in the future in any way you
> see fit. If you want to speed up the process of conversion, use an
> additional field in the database, or a cache, that contains the
> processed content.
>
> 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
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux