MyBB Community Forums

Full Version: "Text" & "Varchar" Characters
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What are the allowed keyboard characters that are able to be used in "Text" & "Varchar?"

And also, which do you prefer using the most, "Text" or "Varchar?"

Thanks
(2011-03-29, 07:47 PM)FooFighter Wrote: [ -> ]What are the allowed keyboard characters that are able to be used in "Text" & "Varchar?"

Depends on the charset. utf8 should accept all.

(2011-03-29, 07:47 PM)FooFighter Wrote: [ -> ]And also, which do you prefer using the most, "Text" or "Varchar?"

It's not about what you prefer, it's about when it's needed.

varchar is limited to 255 chars, good for short pieces of text.

text can have tons of text (within reason), which is good for full articles.

Ok, one more question mate;

Page load times

Do page load times vary depending on lets say a 100 character count of "Text" is on page vs a 100 character count of "Varchar" is on page.
Text columns can be much larger than 255 (varchar maximum), but they require an extra byte for the length portion of the record, so varchar will be ever so slightly faster than text.. Overall I don't think it would make much of a difference, but it depends on database/table size.
but it also eats up disk space and ram using text when you dont need it. the record size is pre-defined so a text field is much larger than a varchar field. more bytes = more disk space and more ram to read/store it.

if you dont need more than 255 characters supported for a given field, then go varchar.