unistake Posted October 29, 2010 Share Posted October 29, 2010 Hi all, I am wondering what the best way to store lots of text on mysql input by a web user is. The text would be for a user to describe a product in detail and could be anything from 10 - 500 words long. (or more!) It would need to store the paragraphs created in the html form field. Any suggestions would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/ Share on other sites More sharing options...
luca200 Posted October 29, 2010 Share Posted October 29, 2010 I don't see the problem. You just need a text column. Or am I missing something? Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128024 Share on other sites More sharing options...
unistake Posted October 29, 2010 Author Share Posted October 29, 2010 There is no problem, I am just not sure what type of field to use like LONGTEXT, BLOB, VARCHAR etc for this. Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128055 Share on other sites More sharing options...
fenway Posted October 30, 2010 Share Posted October 30, 2010 There is no problem, I am just not sure what type of field to use like LONGTEXT, BLOB, VARCHAR etc for this. Depends on the length -- these days, varchar stores up to 65kB, so it's the best choice, unless you have binary data. Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128495 Share on other sites More sharing options...
unistake Posted October 31, 2010 Author Share Posted October 31, 2010 ok thanks. Is there also a TEXT I could use instead of VARCHAR? Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128779 Share on other sites More sharing options...
fenway Posted November 1, 2010 Share Posted November 1, 2010 ok thanks. Is there also a TEXT I could use instead of VARCHAR? Yes, but it's evil -- performance losses all over the place. If you're certain you won't exceed 65kB, don't use TEXT. Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128818 Share on other sites More sharing options...
gamer-goddess Posted November 1, 2010 Share Posted November 1, 2010 Maybe I've been doing this wrong this whole time, but when I need a user to input multiple paragraphs of text, i'd have the write inside a textarea and set that to longtext in the database I am by no means an expert and I'm self taught, so I could be wrong, but I thought varchar had a maximum amount of characters? Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128856 Share on other sites More sharing options...
unistake Posted November 1, 2010 Author Share Posted November 1, 2010 ok thanks fenway Link to comment https://forums.phpfreaks.com/topic/217194-storing-lots-of-text/#findComment-1128903 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.