I have images generated by while loop php based on how many course user have
when user press on one of those images it will send him to that course page
but all images send to one course page
this my php code in** home page **
<?php
$con=mysqli_connect("localhost","FYP","123","FYP");
$sql= mysqli_query($con, "SELECT C_Code FROM F_COURSES WHERE F_ID=".$_SESSION['userid']);
while($row = mysqli_fetch_array($sql)){
echo " <a href='course.php'><div class='cc' id='tres'><img class='icon' src='bookicon1.png'><p class='pra'>".$row['C_Code']."</p></div></a> ";
$C_Code = $row['C_Code'];
$_SESSION['course'] = $C_Code;}
?>
and this code for **course page **
this is <?php
echo $_SESSION['course'];
?> course.
I hope my question make sense and I appreciate your help