Ninjakreborn Posted October 29, 2006 Share Posted October 29, 2006 For larger amount's of text when saved within a database, is it better to use longtext, or blob datatypes. Quote Link to comment https://forums.phpfreaks.com/topic/25496-blob-or-longtext/ Share on other sites More sharing options...
wildteen88 Posted October 29, 2006 Share Posted October 29, 2006 Well blob (which is the same as text) can only store just over 65,500 characters which is about 63KB of text. However longtext allows you to store dramatically more characters just under 4.3 trillion characters! Have a look at this [url=http://www.ilovejackdaniels.com/mysql_cheat_sheet.png]MySQL Cheat Sheet[/url] to see what each data types holds.You'll probably want to use MEDIUMTEXT instead, which holds about 17 million characters, which is about 16MB.1 character is a byte. Quote Link to comment https://forums.phpfreaks.com/topic/25496-blob-or-longtext/#findComment-116332 Share on other sites More sharing options...
toplay Posted October 29, 2006 Share Posted October 29, 2006 There's other considerations to think about other than just how many bytes a data type will hold. For instance, if you ever plan on using full-text searches and create a full-text index, then use a text based data types instead of blobs. You can't create full-text indexes for blobs.http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html Quote Link to comment https://forums.phpfreaks.com/topic/25496-blob-or-longtext/#findComment-116340 Share on other sites More sharing options...
fenway Posted October 29, 2006 Share Posted October 29, 2006 If it's text, use TEXT... if it's binary data, use BLOB. Quote Link to comment https://forums.phpfreaks.com/topic/25496-blob-or-longtext/#findComment-116414 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.