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

Posted by mrcakey on 07/03/07 09:35

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

 

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

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