Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

<!

DOCTYPE html>

<html>

<head>

<title>Patient Records Management System</title>

</head>

<body>

<h1>Patient Records Management System</h1>

<table border="1">

<thead>

<tr>

<th>Patient ID</th>

<th>First Name</th>

<th>Last Name</th>

<th>Address</th>

<th>Contact Number</th>

</tr>

</thead>

<tbody>

<?php

// Connect to the database

$conn = new PDO('mysql:host=localhost;dbname=patient_records', 'root', '');

// Get all patients from the database

$sql = 'SELECT * FROM patients';

$results = $conn->query($sql);

// Loop through the results and display them in the table

foreach ($results as $row) {


?>

<tr>

<td><?php echo $row['id']; ?></td>

<td><?php echo $row['first_name']; ?></td>

<td><?php echo $row['last_name']; ?></td>

<td><?php echo $row['address']; ?></td>

<td><?php echo $row['contact_number']; ?></td>

</tr>

<?php

?>

</tbody>

</table>

</body>

</html>

---------------------------

<!DOCTYPE html>

<html>

<head>

<title>Patient Records Management System</title>

</head>

<body>

<h1>Patient Records Management System</h1>

<table border="1">

<thead>

<tr>
<th>Patient ID</th>

<th>First Name</th>

<th>Last Name</th>

<th>Address</th>

<th>Contact Number</th>

</tr>

</thead>

<tbody>

<?php

// Connect to the database

$conn = new PDO('mysql:host=localhost;dbname=patient_records', 'root', '');

// Get all patients from the database

$sql = 'SELECT * FROM patients';

$results = $conn->query($sql);

// Loop through the results and display them in the table

foreach ($results as $row) {

?>

<tr>

<td><?php echo $row['id']; ?></td>

<td><?php echo $row['first_name']; ?></td>

<td><?php echo $row['last_name']; ?></td>

<td><?php echo $row['address']; ?></td>

<td><?php echo $row['contact_number']; ?></td>

</tr>

<?php

?>
</tbody>

</table>

</body>

</html>

-------------

CREATE TABLE users (

id INT NOT NULL AUTO_INCREMENT,

first_name VARCHAR(255) NOT NULL,

last_name VARCHAR(255) NOT NULL,

username VARCHAR(255) NOT NULL,

password VARCHAR(255) NOT NULL,

user_type VARCHAR(255) NOT NULL,

PRIMARY KEY (id)

);

CREATE TABLE patients (

id INT NOT NULL AUTO_INCREMENT,

first_name VARCHAR(255) NOT NULL,

last_name VARCHAR(255) NOT NULL,

address VARCHAR(255) NOT NULL,

contact_number VARCHAR(255) NOT NULL,

PRIMARY KEY (id)

);

CREATE TABLE check_up (

id INT NOT NULL AUTO_INCREMENT,

patient_id INT NOT NULL,


check_up_date DATE NOT NULL,

temperature FLOAT NOT NULL,

height FLOAT NOT NULL,

weight FLOAT NOT NULL,

insurance VARCHAR(255) NOT NULL,

complains VARCHAR(255) NOT NULL,

findings VARCHAR(255) NOT NULL,

prescription VARCHAR(255) NOT NULL,

return_checkup DATE NOT NULL,

PRIMARY KEY (id),

FOREIGN KEY (patient_id) REFERENCES patients(id)

);

You might also like