|
Posted by google on 09/20/05 16:38
I am using MySQL to keep a database containing tables 'merchants' and
'products'.
My 'products' table has an auto-incrementing id for each record, other
fields, and a 'merchant' field. My 'merchant' table also has an
auto-incrementing id. Is this a candidate for a relationship between
the two ? At present, I use phpMyAdmin to enter the text 'amazon.co.uk'
for the merchant.merchant field.
Should I have a php script which reads the user input 'amazon' and does
a SELECT query on 'merchants' to pull the id for 'amazon', then INSERT
it into a 'merchant_id' field in table 'products', thereby dispensing
with the word 'amazon' in the 'products' table in order to improve
efficiency ?
I am new to MySQL and am unclear about how far to separate data into
separate tables. For example, in a database of clothes, would it make
sense to have a table of 'colours','sizes','material' ? If this is the
case, then is the linking done through a html/php form which replaces
the word 'red' with the id for 'red' in the colours table ?
Thank you for any help....
Navigation:
[Reply to this message]
|