diff --git a/index.php b/index.php index 0180df6357de8a154a9089a073b7d5959afbc108..7fc1702b32013a73aa0cbff94c3b61057584cdd4 100644 --- a/index.php +++ b/index.php @@ -1,7 +1,7 @@ <?php $servername = "db"; $username = "demo"; -$password = "12456"; +$password = "123456"; $dbname = "demo"; $conn = new mysqli($servername, $username, $password, $dbname); @@ -11,7 +11,7 @@ if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } -$sql = "SELECT id, fname, lname FROM student"; +$sql = "SELECT id, fname, lname, score FROM student"; $result = $conn->query($sql); if ($result->num_rows > 0) { @@ -40,11 +40,12 @@ if ($result->num_rows > 0) { } </style>"; - echo "<table> + echo "<table id='studentTable'> <tr> <th>ID</th> <th>First Name</th> <th>Last Name</th> + <th>Score</th> </tr>"; while($row = $result->fetch_assoc()) { @@ -52,6 +53,7 @@ if ($result->num_rows > 0) { <td>" . htmlspecialchars($row["id"]) . "</td> <td>" . htmlspecialchars($row["fname"]) . "</td> <td>" . htmlspecialchars($row["lname"]) . "</td> + <td>" . htmlspecialchars($row["score"]) . "</td> </tr>"; }