Newbie Question -- One to many relationship / mySQL tables
| From: | Eric J Schwinder | Date: | Fri, 28 Sep 2001 03:16:41 +0000 |
| Subject: | Newbie Question -- One to many relationship / mySQL tables | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-12812@lists.php.net to get a copy of this message | ||
I apologize in advance for what is probably a very newbie question, as I am
still new to both mySQL and PHP but here goes:
I have two tables in my database that have a one to many relationship.
Table A is a list of scheduled classes, table B is the list of possible
class titles and their descriptions. One field in table A establishes the
relationship between the two tables: each record in table A has a unique ID
from a record in table B.
I think I should be able to write the SELECT query to display the complete
data set (Date, Time, Title, Description) on the "Display Schedule" page,
but I am not sure how to build my data entry form. I want the user to enter
a date and time and then select the class (by title) from a drop-down. I
need to write a SELECT query to generate the possible values of the drop
down list, INSERT and UPDATE queries for when the user inserts or edits
data.
Can anyone suggest a good reference, tutorial, or example SQL / PHP to help
me along? Thanks!
Eric J Schwinder
eric.AT.bergencomputing.DOT.com