-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpews_cadastrados.php
More file actions
37 lines (32 loc) · 944 Bytes
/
pews_cadastrados.php
File metadata and controls
37 lines (32 loc) · 944 Bytes
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
35
36
37
<?php
// Include database connection
include 'db.php';
// Get the patient ID from the query parameter
$id = isset($_GET['id']) ? intval($_GET['id']) : 0;
if ($id > 0) {
// Fetch the record with the matching ID from the 'pews' table
$stmt = $conn->prepare("SELECT * FROM pews WHERE id = ?");
$stmt->bind_param("i", $id);
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
echo "<h1>PEWS Cadastrados</h1>";
echo "<ul>";
while ($row = $result->fetch_assoc()) {
echo "<li>";
foreach ($row as $key => $value) {
echo htmlspecialchars($key) . ": " . htmlspecialchars($value) . " ";
}
echo "</li>";
}
echo "</ul>";
} else {
echo "<p>Nenhum pews cadastrado.</p>";
}
$stmt->close();
} else {
echo "<p>ID inválido.</p>";
}
// Close database connection
$conn->close();
?>