Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
Thread: what to use? VARCHAR or TEXT?
03-28-2007, 03:14 AM #1
what to use? VARCHAR or TEXT?
I have a doubt.
I have orizinally declared the fields in my table like this:
title varchar(200) default NULL,
But I have limited 'description' and 'keywords' to 300 characters each and 'details' to 1000 characters in my php script.
Now, shall I change it like this:
I have a fulltext index on these fields and I wish to optimize my table for good performance.
please inform me how should I declare my fields.
03-28-2007, 09:16 AM #2
- Join Date
- Jun 2004
- Thanked 0 Times in 0 Posts
varchar can only be 255 characters long.
Code:CHAR( ) A fixed section from 0 to 255 characters long. VARCHAR( ) A variable section from 0 to 255 characters long. TINYTEXT A string with a maximum length of 255 characters. TEXT A string with a maximum length of 65535 characters. BLOB A string with a maximum length of 65535 characters. MEDIUMTEXT A string with a maximum length of 16777215 characters. MEDIUMBLOB A string with a maximum length of 16777215 characters. LONGTEXT A string with a maximum length of 4294967295 characters. LONGBLOB A string with a maximum length of 4294967295 characters.[
03-28-2007, 01:28 PM #3
- Join Date
- Aug 2006
- Floating around somewhere...
- Thanked 42 Times in 42 Posts
this helps me choose on what field type to set, hope it does the same for you
03-28-2007, 01:59 PM #4
Thank you maghiel and rafiki,
I indeed neglected the very basic concepts.
Thanks for the information.