Reply to Re: Learning php Sql -

Your name:

Reply:


Posted by J.O. Aho on 10/03/75 11:50

strawberry wrote:
> With regards the VARCHAR(1) fields listed above, is there any advantage
> (in terms of performance) of CHAR(1) over VARCHAR(1)? Would anyone do
> it differently - other than normalizing it of course?
>

From the MySQL online manual:

The length of a CHAR column is fixed to the length that you declare when you
create the table. The length can be any value from 0 to 255. When CHAR values
are stored, they are right-padded with spaces to the specified length. When
CHAR values are retrieved, trailing spaces are removed.


So CHAR(50) will always be 50 characters long, while a VARCHAR(50) will be as
long as the string stored, to a max of 50 characters. There are more
differences, for more info you can check
http://dev.mysql.com/doc/refman/5.0/en/char.html


//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация