MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:B. Joseph Burch Date:September 16 2003 11:57pm
Subject:URGENT: foreign/linked table keys
View as plain text  
Hello - I've got a simple MySQL/PHP database set up with 3 tables plus a "relationship"
table (using phpMyAdmin.)  The end result is for students to be able to dynamically find
out what books are required for their classes by selecting; term ---> course --->
instructor  ---> (results)

The tables look like this:

  bookID (primary auto increm)
  skuID (unique)

  classID (primary auto increm)
  bookID (foreign key from BOOKS)

  instrID (primary auto increm)

CLASS_BOOKS (relationship table)
  ID (primary auto increm)
  bookID (foreign key from BOOKS)
  classID (foreign key from CLASSES)
  instrID (foreign key from INSTRUCTORS)

The standard rules apply:
  Multiple books for instructors
  Multiple instructors for classes
  Multiple books for classes

I've successfully set up and linked separate admin pages in Dreamweaver to submit data
into the 3 primary tables and they work just fine.  (Yes, I'm a newbie letting Dreamweaver
do most of my coding.)

My question is how do i get the primary keys from each of those 3 tables to feed their
info into the relationship table "class_books"?  (I saw something in the phpMyAdmin
documentation about configuring it to "link" tables(?)) Or do I even need to?  Is it
accomplished though coding in the mysql table or through PHP code?  Does someone know a
tutorial example of this already being done somewhere?  I'm so confused.

Sorry for the long post but I'm trying to be as clear as possible. Of course, I'm on a
deadline and need to get this worked out pretty quickly.

Thanks for your help.

URGENT: foreign/linked table keysB. Joseph Burch17 Sep
  • URGENT: foreign/linked table keysJoseph Burch17 Sep