laPistola Posted December 11, 2008 Share Posted December 11, 2008 Is there a limit to how many charactors these two can hold? if so whats the limits?? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/ Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 Storage requirements for various MySQL data types [added] Sorry, this one will be better Overview of String types Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712589 Share on other sites More sharing options...
laPistola Posted December 11, 2008 Author Share Posted December 11, 2008 hi and thank you i read these pages a few days ago but it dont give me the answer im looking for, or i didn't understand it. its saying a longtext can hold 4gb worth of data but how many characters is that?? Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712610 Share on other sites More sharing options...
fenway Posted December 11, 2008 Share Posted December 11, 2008 Well, since ASCII characters are one byte each.... Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712616 Share on other sites More sharing options...
laPistola Posted December 11, 2008 Author Share Posted December 11, 2008 so about 4.2 mil then Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712620 Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 If you use ASCII or other singlebyte encoding. If UTF-8 (or other multibyte encoding) then less. Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712679 Share on other sites More sharing options...
fenway Posted December 11, 2008 Share Posted December 11, 2008 Potentially up to 3 times less. Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712719 Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 Up to four times less with UTF-32/UCS-4 (extremely rarely used... but still ) Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-712721 Share on other sites More sharing options...
laPistola Posted December 11, 2008 Author Share Posted December 11, 2008 well if LONGTEXT gets me 1mil + which it sounds like it will then im sure its enough for the aplication i plan to use it with. One more question though when you submit to a LONGTEXT field and that post is overs its max storage what happens?? Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713005 Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 I imagine it gets truncated (anything over the limit is dropped). At least that's what happens for CHAR and VARCHAR Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713024 Share on other sites More sharing options...
fenway Posted December 11, 2008 Share Posted December 11, 2008 Unless you're in strict mode, then it will barf. Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713039 Share on other sites More sharing options...
laPistola Posted December 11, 2008 Author Share Posted December 11, 2008 so the user will not get any nasty errors, maybe just in case i should limit the text field and have a warning come up when so many charactors are reached! Thanks for all your help Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713043 Share on other sites More sharing options...
fenway Posted December 11, 2008 Share Posted December 11, 2008 Not million, BILLION... and it will never happen. Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713045 Share on other sites More sharing options...
Mchl Posted December 11, 2008 Share Posted December 11, 2008 Do you expect your users to put more than one billion (yes billion 1'000'000'000, you were wrong with million and no one noticed until now ) characters into a text field? That would take some time. Like... half a life... Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713048 Share on other sites More sharing options...
laPistola Posted December 12, 2008 Author Share Posted December 12, 2008 well the sites based on story writers (authors), a place where they can write stories save them and go back and add to them or edit them and share them with the community on the site. although most will be short stories 50k charactors or less i did think a few might fancy themselves as long story writers (i fancied doing one) which could hit 1mil for a very long 500 page story, which is unlikely i agree as its been pointed out its billion i dont think ill bother putting a limit or warning cus that will never be reached. It was just something that was on my mind but thanks to you guys its not no more Thank you! Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713227 Share on other sites More sharing options...
corbin Posted December 12, 2008 Share Posted December 12, 2008 Wow... At the rate I'm writing a story, a 500 page story actually would be about 1kk characters x.x. lol. 30 pages right now and 81k characters. But yeah, to add something useful, you'll most likely run out of harddrive space before column space with a TEXT, or especially LONG TEXT field. Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713398 Share on other sites More sharing options...
fenway Posted December 12, 2008 Share Posted December 12, 2008 All of Shakespeare's works COMBINED is only 5.32 MB.... Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713704 Share on other sites More sharing options...
Mchl Posted December 12, 2008 Share Posted December 12, 2008 All of Shakespeare's works COMBINED is only 5.32 MB.... Of raw text I imagine... Add some formatting and you might go as high as 8MB Quote Link to comment https://forums.phpfreaks.com/topic/136516-text-long-text/#findComment-713774 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.