Page 1 of 1

big confusion

Posted: Sat Jun 28, 2008 6:09 am
by sunil.23413
how to make a table having different fields to keep record of differnt users on different dates?
i m making a table having three field chest,waist and arm.now i m to add two more fields users and date, so that i can enter the records of different users on different dates....

Re: big confusion

Posted: Mon Jun 30, 2008 3:39 am
by deeessay
I've read your post twice... and I think I get what you mean....okay so i think this is what you should do:

first let us call the table where the fields chest, waist and arm are located and let's call that table measurements

in the measurements table, let's add these fields:

1. measument_id - this will be the primary key for this table, you can set this to auto-increment if you wish.
2. user_id - as its name implies, this holds the unique identifier for the user


To solve your problem, let's create a new table and let's call it measurement_date

In measurement_date, let's add these fields:

1. mdate_id - the primary key
2. measurement_id - this will have the same value as the measurement_id in the table measurement
3. mdate - the date when the measurement was taken


So you see, if you want to get all measurements of a particular user, you can get all of his/her measurements in the measurement table by querying the measurement_id and then you can use that measurement_id to find out when the measurement was taken in the measurement_date table.


I know I probably bored you with my reply but I do hope this answered your question. Good day!

Re: big confusion

Posted: Mon Jun 30, 2008 7:35 am
by sunil.23413
thanks for helping ...i have understood ur reply and will apply it soon....