MySQL field type for a comments field or text area

Yvonne picture Yvonne · Mar 18, 2010 · Viewed 7.5k times · Source

As the title says, I'm after a good field type for a comments field I have in a table. It will store many characters (as users can continuously add to it) so it's definitely over 255. I looked at longtext but wasn't sure...Also how do I change the field type to accept different characters such as apostrophies. Thanks.

Answer

Dean Harding picture Dean Harding · Mar 18, 2010

LONGTEXT is what you want (maybe even MEDIUMTEXT or just TEXT depending on the maximum length of text you're expecting: TEXT can store up to 65KB of text, which is usually more than enough.

All of these fields can store UTF-8 encoded Unicode, so I'm not sure what you mean by the second part of your question (about apostrophies).