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);
    $q="select * from Student where StudentID='$StudentID'";
    $run=mysqli_query($conn, $q);

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

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