terryds Posted July 3, 2013 Share Posted July 3, 2013 I'm confused which one of TEXT and VARCHAR is better to use as a data type to store a blog post, title blog (which have a large amount of text)... Can you give me any suggestion? Link to comment Share on other sites More sharing options...
niche Posted July 3, 2013 Share Posted July 3, 2013 I would make blog posts TEXT if you won't need it as a key. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 3, 2013 Share Posted July 3, 2013 Here's a list of the data types and their storage requirements: http://dev.mysql.com/doc/refman/5.6/en/storage-requirements.html You can give a varchar column any size, but it is limited by the maximum size of a single row of data (including all columns), which is 64KB. Text columns do not add to the maximum row size, because the actual text is not stored with the rest of the row. There's a description of the text and blob types here, with differences between that and varchar: http://dev.mysql.com/doc/refman/5.6/en/blob.html 1 Link to comment Share on other sites More sharing options...
Dreadful_Code Posted July 8, 2013 Share Posted July 8, 2013 Use text for a blog post, since it is capped at 65,535 bytes and varchar for a teaser, since it is usually capped at 255 bytes. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now