Re: HTML stored in a text field

From: Date: Wed, 06 Oct 2004 16:26:13 +0000
Subject: Re: HTML stored in a text field
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-36654@lists.php.net to get a copy of this message
Gabe Covert wrote:
I have a database which has a BLOB field storing text... It should probably be in a text field, but I don't think that's the problem... The field has HTML control codes, such as <b>, </b>, and <p>. When I echo them from the database, a la: echo "<td>" . $row['textfield'] . "</td>" I get the contents of the field with the tags showing up, isntead of applying to the HTML. How can I get these tags to aplpy to the text in the field?
Not really following your explanation, but if you have "<b>word</b>" as your text and you want the actual bolded word to show up in the table cell, then use what you have above. If you want the literal "<b>word</b>" to show up, then use this: echo '<td>' . htmlentities($row['textfield']) . '</td>'; -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com

« previous php.db (#36654) next »