Displaying HTML code pulled from a database
Glen Barnes <[email protected]> Sun, 3 Oct 2004 22:51:51 +0100
| Newsgroups | gmane.text.xml.o-xml |
|---|---|
| Message-ID | <[email protected]> |
Martin,
We were discussing the other day about reading/writing HTML code to
databases. Well I just tested reading HTML inputed from a form,
processed with o-xml and writing it to a database.
This is what I input:
A story with a <a href="www.dirtyeye.com">link</a> to my website.
Wonder If it works.
This is what gets stored in the DB:
+---------+---------------------+-----------+-------------------------
+-----------------------------------------------------------------------
----------------+
| item_id | pub_date | posted_by | title |
story
|
+---------+---------------------+-----------+-------------------------
+-----------------------------------------------------------------------
----------------+
| 8 | 2004-10-03 10:40:48 | 3 | A new story |
A story with a <a href="www.dirtyeye.com">link</a> to my website.
Wonder If it works.
+---------+---------------------+-----------+-------------------------
+-----------------------------------------------------------------------
----------------+
8 rows in set (0.00 sec)
When I read the data back from the database I get this as the HTML
output:
<p>A story with a <a href="www.dirtyeye.com">link</a> to my
website. Wonder If it works.</p>
Is there anyway to output the proper HTML?
Also apart from db:quote() are there any other functions that I can
use in the DB extension to format input?
Thanks,
Glen