tags:

views:

58

answers:

3

I have a varchar(255) field in mysql that is used for displaying the title to a page and I received a request to superscript some characters for a particular title. I updated this title with some html but this doesn't render as expected.

Instead of H2O I get:

H<sup>2</sup>O

Thanks!

+3  A: 

This is unrelated to MySQL, the browser chooses to render it this way. Via http://en.wikipedia.org/wiki/HTML%5Felement#Document%5Fstructure%5Felements

The title element must not contain other elements, only text.

nullptr
A: 

That means you have either htmlspecialchars()ed or htmlentities()ed the text, either on input or on output.

(If you're talking about something like a <h1> tag in the pages <body>, at least. Otherwise the other answerer is right.)

Douwe Maan
excellent, thanks for the explanation!
slimcady
+4  A: 
Jeremy Smyth
Right on, thanks for the info.
slimcady