Results 1 to 2 of 2
Jun 26, 2003, 10:54 #1
- Join Date
- Aug 2001
- Mentor, Ohio
- 0 Post(s)
- 0 Thread(s)
limiting table values pulled from one table and put into another
ok here's my situtation..
two tables (- and variables)..
- course_name (pulled by tbl_courses, and lists courses from that table
- tees_used (pulled by tbl_courses, but only want to show tees for the course selected above.
lets say that (tbl_courses) looks like this:
what i want is: when someone selects a course_name in the tbl_tournament, i want the tees_used in the tbl_tournament to only show colors available for that selection..
right now, no matter what, i get the list 'red,blue,green,yellow,brown,black' when all i really want for selecting course1 is red,blue,green..
anyone have any sugguestions.
Jun 26, 2003, 12:34 #2
Your database is not normalized, giving you headaches. If its still possible, you should rearrange your schema now to something like this:
CourseID (autoid, long integer), course_name (text, 255)
and so on...
In a second table, you put all avalaible tees:
TeeID(autoid, long integer, primary key), tee_name (text, 255)
and so on...
in the 3rd table, you create associations based on combinations from the first table, like this:
and so on.
So here you have your relationship between what tees are available on what courses. Similarly for tournaments, create a Table_Tournaments with an autoid (primary key) named TournamentID and the course name. Then create a 5th table containing only the fields CourseID and TournamentID. If some Tees are only used in some tournaments you can add the field TeeID here too.
Selecting the acurate data should be easy now