| | |
|
|
|
Re: ASP and database question |
| message from cmbergin on 21 Jul 2004 |
Your form would only have to update the Registrations table when you are
registering a student.
Pull StudentID, Name into a recordset and create a dynamic menu (if you're
doing the registration), or insert the logged-in student's ID into a hidden
field.
Pull ClassID, Name into a recordset and create a dynamic menu.
The registration form then merely has to insert StudentID and ClassID into the
Registrations table. No need to update the other two tables.
To insert multiple records (or in this case, to register for multiple classes)
only submitting a form once, read here:
http://www.drdev.net/article01.htm
|
| Seth Meranda replied to cmbergin on 21 Jul 2004 |
Ahhh, so are you saying I have a form that will insert all the student's
data (first name, last name, age, etc....) into the student table on one
page. Then after submiting this form, another page loads where I have the
dynamic menus that would update my joined table (i.e. the Registrations
table)?
Then I can create a recordset from the joined table, which I can use for my
class roster page? How can I pull the class name (in the class table) and
the student's name (in the student table) to this recordset display?
Seth Meranda
web<at>meranda.org
"cmbergin" <webforumsuser@macromedia.com> wrote in message
news:cdmjcv$c6m$1@forums.macromedia.com...
|
| Les Matthews replied to Seth Meranda on 22 Jul 2004 |
Put the studentID in a hidden form element. If you have just inserted the
record, you will have to retrieve the ID. If you are the only one inserting
new students, you should be safe by just selecting the ID corresponding to
the last record in the Students table. If you are creating a class
registration for an already existing student, then do as cmbergerin
suggested and create a recordset retrieving StudentID, FirstName and
LastName from the Students table and use that to populate a select form
element. You can then select the student you wish to sign up for a class.
Build a recordset to retrieve your Class information.
Build an Insert Record behavior that will insert into the Registrations
table the StudentID from the hidden element (or select element) and the
ClassID that is selected on the page (could be from another select element
or from a repeat region with checkboxes).
I should also mention that the db design I gave you yesterday is rather
simplistic - especially in regard to class schedules. For instance American
History 101 spanning 90 minutes on Tuesday and Thursday afternoons should be
the same class as American History 101 spanning 180 minutes on Wednesday
nights - same class, different schedule. You really shouldn't have a class
repeated in the Class table just because it is offered multiple times. Just
keep saying to yourself "duplicate data - bad".
You might consider also building a ClassSchedule table, looking something
like:
ScheduleID ClassID StartDate EndDate StartTime EndTime
|
|
Archived message: Re: ASP and database question (Macromedia Dreamweaver Web Design)