tags:

views:

48

answers:

3

I'm doing a quick and dirty CMS module for a site - just a jWYSIWYG editor.

I've never really thought about the best type to use for the column that will contain the outputted XHTML from the editor. I have always used blob in the past, but am unsure why I picked that.

Any recommendations?

+2  A: 

Well, since you're storing XHTML data in the database (whether that is acceptable or not is an entirely separate discussion), it's not unreasonable to use a TEXT column instead, since that's all XHTML really is.

Of course, you will want to mind your character encoding.

Matt
A: 

TEXT is the safest because you won't be limiting the field size in any way, (however you might want to throw a limit in there anyway) and will probably accept the most exceptions.

Jeremy Morgan
+1  A: 

I would suggest that you just use TEXT. Or if you're concerned about having a large enough space, then you could use LONGTEXT.

Noah Goodrich