Page 1 of 1

Linking Multiple Tables togetyher in MySQL?

Posted: Sun Dec 22, 2002 5:58 am
by Elmseeker
Hi everyone,

I am currently working on designing the back end of a site for children, parents and teachers. I need to be able to link table entries with entries in other tables.

Example:
  1. Child comes to site and creates an account.
  2. An account is automagically created for the parent as well and passwords emailed.
  3. Parent logs in later and wishes to change the permission of what parts of the site their child is allowed to access.
How?! My DB entry for parents is listed as such:
ID, rname, email, u_name, u_pass, kid0, kid1, kid2, kid3, kid4, kid5, kid6, kid7, kid8, kid9, u_level
Would this be as simple as placing the ID of the childs DB entry into the kid0-kid9 places and loading the appropriate stats for each child on a click or use of drop down? If so, how would it work the other way around? I mean, how would the child be able to access their parents info?

Thank you in advance for your help.

what if

Posted: Sun Dec 22, 2002 9:49 am
by AVATAr
what if there where 11 kids (my father haave, 6 sisters and 4 brothers!!!)
you have to split the tables:

Parents Table
ID_par, rname, email, u_name, upass, u_level

Kids Table
ID_par, kid

You link the two tables with the ID_par..