Re: Best way to store data.

From: Date: Fri, 19 Dec 2003 03:24:34 +0000
Subject: Re: Best way to store data.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-172994@lists.php.net to get a copy of this message
Philip J. Newman wrote:
Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML format ... changing all the \r's and things to <br>
Depends what you're going to be doing with it. If you know it's only going to go back out to web pages, then it'd make sense to do conversions only once instead of each time it's viewed. If this text can be put into text emails, then you don't want it converted. I prefer to run htmlentities() before saving it in the database, but not nl2br(). htmlentities() helps when you place the data back into form input elements. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.general (#172994) next »