Store HTML in a MYSQL table and then deploy it to a page
Posted: Mon Aug 31, 2009 9:45 am
Hello Guys,
Once again i need some assistance, hope you can help.
I have a MySQL DB within the db is a table with a field which i want to hold some HTML.
The Table is called CONTENT_NEWS
Field: ARTICLE_HTML
Type: longtext
Collation: armscii8_general_ci
Attributes:
Null: No
Default: None
Extra:
When i paste the HTML into the field (im doing it through phpMyAdmin until i make a front end i get the following error:
0 row(s) affected.
Warning: #1366 Incorrect string value: '\xC2\xA360 B...' for column 'article_html' at row 1
When i then try and display it in my broswer using
<?php echo htmlspecialchars($row_news['article_html']); ?>
OR
<?php echo htmlentities($row_news['article_html']); ?>
it just shows the HTML within my webpage. If i copy and paste it into another doc it works fine so the problem looks like its not actually trying to display it as HTML. Im from an ASP background and am used to doing response.write()
Any help would be greatly appriciated
Mario
Once again i need some assistance, hope you can help.
I have a MySQL DB within the db is a table with a field which i want to hold some HTML.
The Table is called CONTENT_NEWS
Field: ARTICLE_HTML
Type: longtext
Collation: armscii8_general_ci
Attributes:
Null: No
Default: None
Extra:
When i paste the HTML into the field (im doing it through phpMyAdmin until i make a front end i get the following error:
0 row(s) affected.
Warning: #1366 Incorrect string value: '\xC2\xA360 B...' for column 'article_html' at row 1
When i then try and display it in my broswer using
<?php echo htmlspecialchars($row_news['article_html']); ?>
OR
<?php echo htmlentities($row_news['article_html']); ?>
it just shows the HTML within my webpage. If i copy and paste it into another doc it works fine so the problem looks like its not actually trying to display it as HTML. Im from an ASP background and am used to doing response.write()
Any help would be greatly appriciated
Mario