Re: Because you guys/gals/girls/women/insert pc term here are a smart lot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, start here:

http://dev.mysql.com/doc/refman/5.1/en/string-types.html

Stuart wrote:

>> varchar: only the space required for the content of the field is
>> allocated per row but these fields are limited to 255 chars (IIRC) in
>> length.

In MySQL, varchar can hold "up to" 65,535 characters, but the actual
maximum size is limited by the maximum row length (65,535 bytes) and the
character set (e.g. utf8 uses between one and three bytes per
character).

Maybe you're thinking of char, which is limited to 255 characters.

Robert Cummings wrote:

>It's generally worth mentioning that you can usually index char or
>varchar, but not text.

No, you can index a text column, but it will only index part of the
column:

"Only the first max_sort_length bytes of the column are used when
sorting. The default value of max_sort_length is 1024." - TFM.

Also, you can create a FULLTEXT index on text columns stored in the
MyISAM engine. (which is a PITA, because if you want ACID transactions
and full-text searching, you need to create and maintain a MyISAM shadow
table of the data you want to full-text search on)
--  
Ross McKay, Toronto, NSW Australia
"The lawn could stand another mowing; funny, I don't even care"
- Elvis Costello

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux