Re: Question
| From: | Duncan Hill | Date: | Sun, 23 Jun 2002 18:15:41 +0000 |
| Subject: | Re: Question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-20016@lists.php.net to get a copy of this message | ||
On Sun, 23 Jun 2002, Mike Tuller wrote:
> I know I will need to create a separate table to hold information about
> the drives, and connect them to the computer by attaching the primary key
> of the drives table to the Computer table.
Good, you know a bit about normalisation. But, not enough. Look it up :)
> Computer Table
>
> ComputerID
> DriveID
> ------------------------
> Drive Table
>
> DriveID
Nope.
Computer table:
computer id
computer model
computer location
Drive table
computer id
drive id
drive model
drive size
Then use SQL to join the tables on computer id to get the appropriate info.
Probably something like select computer.model, computer.location, drive.size
from computer, drive where drive.computerid = computer.computerid and
computer.computerid = blah
Or something so.