You are here: Re: Php mysql - messing with my head « All PHP « IT news, forums, messages
Re: Php mysql - messing with my head

Posted by Rik on 06/07/06 02:10

moosus wrote:
> Something like a session id can contain both numbers and letters ->
> hence making the field text.

But not pages & pages, VARCHAR seems the way to go, and for a lot of other
fields too.

> `n2` text NOT NULL, = Person's Name
> `n3` text NOT NULL, = Person's Name
> `n4` text NOT NULL, = Person's Name
> `n5` text NOT NULL, = Person's Name
> `n6` text NOT NULL, = Person's Name
> `n7` text NOT NULL, = Person's Name
> `n8` text NOT NULL, = Person's Name
> `n9` text NOT NULL, = Person's Name
> `n10` text NOT NULL, = Person's Name
Are you sure these shouldn't be in a separate table, linked to the id
earlier?

> `industrytype` text NOT NULL, = Industry Type (from drop down)
> `affiliation` text NOT NULL, Affiliation (from drop down)
enum?

> `rego` text NOT NULL, = YES / NO (tick box)
bool, autmatically converted into tinyint(1) is what I usually choose: 0 or
1.

> `expiry` text NOT NULL, = Date (mm/yyyy)
Why not a real date? When using/displaying the information, you can always
choose to check/display only the month & year.

If your table is large enough, running the query:
SELECT * FROM `afta` PROCEDURE ANALYSE ()

Will give a lot of hints, but it's not entirely correct all the time.

In smaller tables, try:
SELECT * FROM `afta` PROCEDURE ANALYSE (20)
or something like that: it's the maximum number of distinct values MySQL
will consider valid for ENUM, which defaults to 256.

Grtz,
--
Rik Wasmus

 

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

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