At 1:55 PM -0500 12/11/08, Robert Cummings wrote:
Student attendance should be a table with rows for each student in
attendance. If you want to limit the number make a check before adding
another student. Don't hard code the number via fields like above or
you'll find it overly ugly to add/remove students or even increase the
number of allowed students. As it stands to allow 6 students you would
have to add 2 more columns. With attendance controled by a table with a
row for ewach attendance you would only need to update a configuration
variable the determines the maximim number of allowed students in
attendance.
Cheers,
Rob.
Rob:
I see -- the solution is a table for courses, students, instructors
and enrollment.
The enrollment table will hold links to all (third normal).
If I want to limit the number of students in a course, then just
count the number of students enrolled in a specific course within the
enrollment table and check that number against the maximum allowed
before adding another enrollment record.
Also, if a student cancels, then it's only a deletion of an
enrollment record and all is right with the world.
That's good.
Sometimes it's good to talk things like this through -- clears the
fuzzy thinking.
Thanks,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php