-
Notifications
You must be signed in to change notification settings - Fork 0
/
Record.php
34 lines (27 loc) · 969 Bytes
/
Record.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$servername = "localhost";
$username = "ageCalc";
$password = "password";
$dbname = "ageCalcRecords";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$callState = "SELECT FName, SName, BirthDate, EntryDate, AgeRecorded, MarsAgeRecorded FROM record_of_request2;";
$data=$conn->query($callState);
$conn->close();
echo '<link rel="stylesheet" type="text/css" href="css/style.css"/>';
echo "<table>
<tr>
<th>First Name</th>
<th>Surname</th>
<th>Entered Birtday</th>
<th>Date Entered</th>
<th>Age Reported</th>
<th>Mars Age Reported</th>
</tr>";
while($row = $data->fetch_assoc()) {
echo "<tr> <td>" . $row['FName'] . "</td> <td>" . $row['SName'] . "</td> <td> " . $row['BirthDate'] . "</td> <td>" . $row['EntryDate'] . "</td> <td>" . $row['AgeRecorded'] . "</td> <td>" . $row['MarsAgeRecorded'] . "</td></tr>";
}
echo "</table>";
?>