hi Jamie

I' not too sure about the fields for the tables but I think a better way to
implement this is to seperate the items from the options hence you have
three tables instead of one,ie

table 1
   *product_id, 
    ....(other product fields)

table 2
   *option_id, 
    name, 
    value, 
    ...(whatever you need)

table 3
  *+product_id,
  *+option_id

Explanation:
Table 1 is used to hold data about the product, ie data that is relevant to
the product only.  table 2 is used to keep track of the various options that
you require.
Table 3 will be used to link the product to an option.
This way you can alter your options,add or delete, without changing your
tables all the time, remember to to try and keep only unique data in a table
otherwise you end up duplicating things.  Also maintenance becomes a pain(my
opinion)



regards
Barry


-----Original Message-----
From: Jamie [mailto:[EMAIL PROTECTED]]
Sent: 31 January 2001 02:25
To: Mysql@Lists. Mysql. Com
Subject: Finding the 'field names'


I was wondering what the SQL command is to find the filed names of a
database once it has been created.

I'm trrying to write a script that will allow 'options' table to be created
where there is an ID fiield for the product then fields representing each of
the avalible options eg red blue green which are going to be a boolean
variable. I'm hopeing that this is the best way tyo do this as each product
can have multiple options and there may even be more option fields added at
a later date (which is why I need to be able to find them)

My table design:
___________________________________________
| Product_ID | Red | Blue | Green | Yellow | A4 | A5 |
|------------------|--------|---------|----------|-----------|------|------|
|_12345678_|__+__|_____|__+__|__+___|____|____|
|_75487345_|_____|__+__|___+_|______|_+__|__+_|
|_43657322_|_____|_____|_____|______|____|____|
|_12355578_|__+__|_____|__+__|__+___|____|____|
|_66635678_|_____|__+__|__+__|__+___|_+__|____|

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to