Getting Data to show from database

I am trying to get data to show from the database based upon which student was picked in a list. When the person is selected it shows the student’s overview page, the student ID is showing up on the next page but nothing else. Any help would be appreciated

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}  
    $StudentID=$_GET['StudentID'];
    $q="select * from Student where StudentID='$StudentID'";
    $run=mysqli_query($conn, $q);
    while($row=mysqli_fetch_array($run));
    {
         $StudentID=$row[0];
         $fname=$row[1];
         $lname=$row[2];
         $major=$row[3];
         $advisor=$row[4];
         $enrollment=$row[5];
         
         
    
 
    
?>

</head>
<body>
    <h1>Information for StudentID # <?php echo $_GET['StudentID']; ?></h1>
<div class="style1">
<b>Personal Information</b>
<br>
SID: <?php echo $_GET["StudentId"]; ?><br>
First Name: <?php echo $_GET["firstname"]; ?><br>
Last Name: <?php echo $_GET["lastname"]; ?><br><br>
</div>
<div class="style1">
<b>Student Information</b><br>
Major: <?php echo $_GET["Major"]; ?><br>
Advisor: <?php echo $_GET["advisor"]; ?><br><br>
</div>
<div class="style1">
<b>Enrollment Data</b><br>
Enrollment Date: <?php echo $_GET["EnrollmentDate"] ?>
</div>
<br><br>

Personal Information
SID: <?php echo $StudentID; ?>
First Name: <?php echo $fname; ?>
… And so on.

Not the way you have written.

Sponsor our Newsletter | Privacy Policy | Terms of Service