Hi everyone, brand new here and brand new to php. I need to create a series of hierarchical pages containing course and section information. Meaning - the first page is a list of courses which are clickable. When a course is clicked it returns a list of sections only for that course. When a section is then clicked it returns a page contaning information for that section. My problem is that for every page, it is dislpaying all of the information that matches the query, not just the correct information for what was clicked.
I've been told to use $_GET and to pass the variables through the url (there are no forms involved). Honestly, I don't know where to begin on this. Does the query need to be the exact same for every page? Do all of the GET variables need to be assigned on every page? This is what I have for the middle page (list of sections) Right now it's returning a series of undefined index notices and the list of section numbers, but I need one instructor name and then the list of sections they teach right under the name. The section numbers should then be clickable to retrieve the information for only that section which is the course_section.php page. I know this is a mess, and many many thanks in advance for any help.
$course_id = $_GET['course_id'];
$course_name = $_GET['course_name'];
$section_id = $_GET['section_id'];
$semester = $_GET['semester'];
$year = $_GET['year'];
$course_description = $_GET['course_description'];
$SGoal_Description = $_GET['SGoal_Description'];
$sobjective_description = $_GET['sobjective_description'];
$LObjective_Description = $_GET['LObjective_Description'];
$topic_title = $_GET['topic_title'];
$topic_description = $_GET['topic_description'];
$coursework_title = $_GET['coursework_title'];
$coursework_location = $_GET['coursework_location'];
$coursework_description = $_GET['coursework_description'];
$syllabus = $_GET['syllabus'];
$user_fname = $_GET['user_fname'];
$user_lname = $_GET['user_lname'];
$query = "SELECT DISTINCT user_fname, user_lname, section_t.section_id
FROM authorized_user_t, instructor_t, section_t, teaching_history_t
WHERE authorized_user_t.authorized_user_id = instructor_t.instructor_id
AND instructor_t.instructor_id = teaching_history_t.instructor_id
AND teaching_history_t.section_id = section_t.section_id";
$result = @mysql_query($query);
while ($line1 = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<ul align = "center"<strong>' .'Instructor'. ':' ."$user_fname". "$user_lname".'<li align = "center">
<a href ="course_section.php?course_id='.$line1['course_id'].'&course_name='.$line1['course_name'].'§ion_id='.$line1['section_id'].'
&semester='.$line1['semester'].'&year='.$line1['year'].'&course_description='.$line1['course_description'].'
&SGoal_Description='.$line1['SGoal_Description'].'&sobjective_description='.$line1['sobjective_description'].'
&LObjective_Description='.$line1['LObjective_Description'].'&topic_title='.$line1['topic_title'].'
&topic_description='.$line1['topic_description'].'&coursework_title='.$line1['coursework_title'].'
&coursework_location='.$line1['coursework_location'].'&coursework_description='.$line1['coursework_description'].'">'.$line1['section_id'].'</a></strong><br><br>';
}