You are here: Re: Field storage « PHP SQL « IT news, forums, messages
Re: Field storage

Posted by mrcakey on 07/03/07 10:45

"Captain Paralytic" <paul_lautman@yahoo.com> wrote in message
news:1183458148.394512.69990@q75g2000hsh.googlegroups.com...
> On 3 Jul, 10:35, "mrcakey" <nos...@spamispoo.com> wrote:
>> Utterly perplexed by this one. I entered this into my MySQL:
>>
>> create table if not exists user
>> (userid int not null auto_increment primary key,
>> email char(64) not null,
>> nickname char(32),
>> user_pass char(41),
>> reset_ans char(41),
>> block_timestamp timestamp,
>> blocked tinyint,
>> fail_cnt tinyint,
>> auth_pending tinyint,
>> default_home tinyint,
>> pref_email_newsletter tinyint,
>> pref_email_own tinyint,
>> polled tinyint,
>> nominations tinyint,
>> songalike_count int );
>>
>> When it came out at the other end, phpMyAdmin is reporting that all the
>> INTs
>> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea what's
>> going on here?!!!!
>>
>> Also, a related issue, is it necessary to align the fields in byte pairs?
>> This comes from my Tandem programming background - data was stored in
>> byte
>> pairs, so if you had a field that was 5 bytes long for instance, you'd
>> try
>> to stick an odd-byte field next to it so that space wasn't wasted. Do I
>> need to do this for MySQL (just using ISAM)?
>>
>> +mrcakey
>
> To find out what's going on here, I can recommend reading the manual:
>
> http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
>

Thank you. I had spent a good 20 minutes looking at the manual, but
apparently not at the relevant bit. Seems a very weird thing for phpMyAdmin
to want to add the display length when it's not needed.

+mrcakey

 

Navigation:

[Reply to this 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

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