NYCPHP Meetup

NYPHP.org

are enums verboten?

Joshua S. Freeman jfreeman at amnh.org
Mon May 19 15:33:08 EDT 2003


First, thanks to everyone who answered my last salvo of questions.  I look
forward to moving down to NY this summer so I can start meeting you in
person at NYPHP meetings...


This one is more of a MySQL question than a PHP question but here goes..

I'm creating a LAMP app. for a scientist who needs to gather a crapload of
information about a collection of scientific specimens.

The main table ('specimens') has 61 fields.

For fields such as 'species_id' what will go in there is simply the id
number referencing information from a lookup table containing 20 or 30
species names, each with an id number.

(species_id smallint(6) NOT NULL default '0')

For fields such as 'priority' or 'condition' I'm thinking of using type
'enum':

priority enum('1','2','3','4') NOT NULL default '1',
gen_condition enum('good','fair','poor','very poor') NOT NULL default
'good'...

Is this alright?..

or.. should I do the same thing with 'priority' and 'gen_condition' that I
do with 'species_id' ?...

An additional question:

there are NUMEROUS questions in the survey that ask the surveyor to choose
between 'high - moderate - low' ... in reference to various different
parameters in the survey.

do i have just ONE table that looks up 'high', 'moderate', 'low' (like the
species lookup table which has two fields- species_id and species_name) or
do I make different lookup tables for 'high', 'moderate', 'low'... once for
each question in the survey asking "how much incidence of blah-blah do you
see ? high? medium? low?"

I hope my questions are clear.  I look forward to some guidance.

Thanks!

J.




More information about the talk mailing list