Flames Posted October 20, 2008 Share Posted October 20, 2008 What is the best field type to use if im looking at around 10,000 characters as the maximum, this is too high for varchar which limits me at 255, so i used blob instead but in phpmyadmin it only allows me to upload a file, so i uploaded a word document and it became all strange with extra symbols in it. What field type should i use for 10,000 characters? Quote Link to comment https://forums.phpfreaks.com/topic/129203-solved-best-field-type-to-use/ Share on other sites More sharing options...
rhodesa Posted October 20, 2008 Share Posted October 20, 2008 BLOB = Binary Large Object. So that is why it wants a file uploaded. For Text, you want to use one of the following (the number after it is the max characters): VARCHAR - 255 TINYTEXT - 256 TEXT - 65,536 MEDIUMTEXT - 16,777,216 LONGTEXT - 4,294,967,296 that being said, you should be safe with TEXT EDIT: for those interested in how i got those numbers, it's on this page: http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html scroll down to "Storage Requirements for String Types". You will have to do the math (aka 2^16 = 65,536) Quote Link to comment https://forums.phpfreaks.com/topic/129203-solved-best-field-type-to-use/#findComment-669971 Share on other sites More sharing options...
Flames Posted October 20, 2008 Author Share Posted October 20, 2008 thanks, the problem was phpmyadmin wasn't showing all those data types, so i left a message with my host and its fixed. phpmyadmin has been erroring a lot lately. Quote Link to comment https://forums.phpfreaks.com/topic/129203-solved-best-field-type-to-use/#findComment-669975 Share on other sites More sharing options...
fenway Posted October 20, 2008 Share Posted October 20, 2008 VARCHAR is 65K in mysql5.0.3+ -- much better choice than TEXT. Aside: the 5.1 refman page is still wrong on the mysql docs. Quote Link to comment https://forums.phpfreaks.com/topic/129203-solved-best-field-type-to-use/#findComment-670205 Share on other sites More sharing options...
Flames Posted October 20, 2008 Author Share Posted October 20, 2008 my webhost is running localhost * Server version: 4.1.22-standard * Protocol version: 10 * Server: Localhost via UNIX socket * User: a6474246@localhost * MySQL charset: UTF-8 Unicode (utf8) * MySQL connection collation: armscii8_binarmscii8_general_ciascii_binascii_general_cibig5_binbig5_chinese_cibinarycp1250_bincp1250_croatian_cicp1250_czech_cscp1250_general_cicp1251_bincp1251_bulgarian_cicp1251_general_cicp1251_general_cscp1251_ukrainian_cicp1256_bincp1256_general_cicp1257_bincp1257_general_cicp1257_lithuanian_cicp850_bincp850_general_cicp852_bincp852_general_cicp866_bincp866_general_cicp932_bincp932_japanese_cidec8_bindec8_swedish_cieuckr_bineuckr_korean_cigb2312_bingb2312_chinese_cigbk_bingbk_chinese_cigeostd8_bingeostd8_general_cigreek_bingreek_general_cihebrew_binhebrew_general_cihp8_binhp8_english_cikeybcs2_binkeybcs2_general_cikoi8r_binkoi8r_general_cikoi8u_binkoi8u_general_cilatin1_binlatin1_danish_cilatin1_general_cilatin1_general_cslatin1_german1_cilatin1_german2_cilatin1_spanish_cilatin1_swedish_cilatin2_binlatin2_croatian_cilatin2_czech_cslatin2_general_cilatin2_hungarian_cilatin5_binlatin5_turkish_cilatin7_binlatin7_estonian_cslatin7_general_cilatin7_general_csmacce_binmacce_general_cimacroman_binmacroman_general_cisjis_binsjis_japanese_ciswe7_binswe7_swedish_citis620_bintis620_thai_ciucs2_binucs2_czech_ciucs2_danish_ciucs2_estonian_ciucs2_general_ciucs2_icelandic_ciucs2_latvian_ciucs2_lithuanian_ciucs2_persian_ciucs2_polish_ciucs2_roman_ciucs2_romanian_ciucs2_slovak_ciucs2_slovenian_ciucs2_spanish2_ciucs2_spanish_ciucs2_swedish_ciucs2_turkish_ciucs2_unicode_ciujis_binujis_japanese_ciutf8_binutf8_czech_ciutf8_danish_ciutf8_estonian_ciutf8_general_ciutf8_icelandic_ciutf8_latvian_ciutf8_lithuanian_ciutf8_persian_ciutf8_polish_ciutf8_roman_ciutf8_romanian_ciutf8_slovak_ciutf8_slovenian_ciutf8_spanish2_ciutf8_spanish_ciutf8_swedish_ciutf8_turkish_ciutf8_unicode_ci Documentation * Create new database: Documentation No Privileges * Show MySQL runtime information * Show MySQL system variables Documentation * Processes Documentation * Character Sets and Collations * Storage Engines * Databases * Export * Import * Log out Info phpMyAdmin - 2.11.4 * MySQL client version: 4.1.22 * Used PHP extensions: mysql * Language Info: * Theme / Style: * Font size: * phpMyAdmin documentation * phpMyAdmin wiki * Official phpMyAdmin Homepage * [ChangeLog] [subversion] [Lists] so i think ill use text Quote Link to comment https://forums.phpfreaks.com/topic/129203-solved-best-field-type-to-use/#findComment-670212 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.