Hi,
I'm have a database that has stores professors, courses, and students. When a professor logs on the webpage that I am creating, I query the database for all the courses the professor is teaching and print the courses as a link to a page called selcrse.php. My code is below. It works unless I missed something while copying.
<?php
$query="SELECT course_name, course_num, course_section FROM courses,
user_course WHERE user_id='$Someusr' and courses.course_id=
user_course.course_id";
$courseRslt=querydb($query, $ilink);
while($row=mysql_fetch_array($courseRslt))
{
$fchnm=$row['course_name'];
$fchnum=$row['course_num'];
$fchsec=$row['course_section'];
$reCrse=$fchnm." ".$fchnum." ".$fchsec;?>
<CENTER>
<A HREF="selCrse.php"> <?php echo "$reCrse<BR>\n"; ?> </A>
</CENTER>
<?php
} ?>
Lets say that the professor's name is Hugh Jazz and he is currently teaching German and Computer Science classes, then the output is something like below (as links)
GER 1401 01
GER 1402 01
CSI 3395 01
(*Note the number of courese are variable depending on how many classes a professor is teaching.)
They all link to the same page (selcrse.php). If the person clicks on GER 1402 01 then I want to store GER 1402 01 in a session variable so that in selcrse.php I can query the database for all the students for the professor that is logged in and the course that the professor chose(in other words, list the students who are taking GER 1402 01 taught by professor name Hugh Jazz). My problem is storing GER 1401 01. How can I record that the user clicked GER 1402 01 instead of CSI 3395 01 or any other links that are listed from the database. If anyone knows, please let me know as soon as possible. I would greatly apreciate it and I thank you in advance for your time. Ceres
P.S. I'm new to php so I might ask you a lot of questions.