Re: HTML stored in a text field

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

 



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

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux