Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $x = 1;
- $query = "SELECT * FROM `persons` WHERE CODE_NO = '$x'";
- $result = mysqli_query($con, $query);
- }
- $table = "<table>"; // table tag in HTML
- while($row = mysqli_fetch_array($result))
- {
- //Creates a loop to loop through results
- $table .= "<tr>";
- $table .= "<th>CODE_NO:</th>";
- $table .= "<td>" . $row['CODE_NO'] . "</td>";
- $table .= "</tr>";
- $table .= "<tr>";
- $table .= "<th>FIRST_NAME:</th>";
- $table .= "<td>" . $row['FIRST_NAME'] . "</td>";
- $table .= "</tr>";
- $table .= "<tr>";
- $table .= "<th>SURNAME:</th>";
- $table .= "<td>" . $row['SURNAME'] . "</td>";
- $table .= "</tr>";
- $table .= "<tr>";
- $table .= "<th>Date of birth:</th>";
- $table .= "<td>" . $row['DOB'] . "</td>";
- $table .= "</tr>";
- $table .= "<tr>";
- $table .= "<th>Date of death:</th>";
- $table .= "<td> " . $row['DOD'] . "</td>";
- $table .= "</tr>";
- }
- $table .= "</table>"; //Close the table in HTML
- echo $table;
- ?>
Add Comment
Please, Sign In to add comment