In message <[EMAIL PROTECTED]>, edcasati <[EMAIL PROTECTED]>
writes
>I'm working on my first 'real' PHP / MySQL database, and I'm somwhat
>confused about how to 'relate' data.
>
>Imagine running a temp agency. You have two basic mySQL tables: 
>Table1 is employees
>Table 2 is Clients
>
>Each client and employee has one entry in their respective database.
>I want to setup the database so I can keep track of which employee has
>worked with which client, and which client has used each employee. An
>employee can work for multiple clients, and a client can use multiple
>employees.
>
>How do I track those relationships?

>My guess is that the only way is to setup a separate table, with one
>column keyed to employee and another table keyed to client, and have
>them point to the appropriate entities. So in essence there is a third
>table that tracks the relationships, but doesn't contain any 'real'
>data, just pointers to the appropriate row in the 'real' tables. 

That is correct.  However, this 'assignments' table, could also show the
dates of the assignment, what the assignment was for ('typing minutes of
meeting'), and how much was charged, etc.

-- 
Pete Clark

http://www.hotcosta.com
http://www.spanishholidaybookings.com




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/CefplB/TM
--------------------------------------------------------------------~-> 

The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to