Compare commits
No commits in common. "6f8d34417f31bc0bd9781338153c785be3ce5ad4" and "66136e964fa25ac731717ad20e2d2bf8fcde5540" have entirely different histories.
6f8d34417f
...
66136e964f
1 changed files with 0 additions and 80 deletions
|
@ -1,80 +0,0 @@
|
||||||
<?php
|
|
||||||
error_reporting(E_ALL);
|
|
||||||
ini_set('display_errors', 1);
|
|
||||||
|
|
||||||
$host = "192.168.1.20";
|
|
||||||
$database = "ospedale";
|
|
||||||
$user = "pdo";
|
|
||||||
$password = "";
|
|
||||||
|
|
||||||
$datiPazienti = [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$connection = new PDO("mysql:host=$host;dbname=$database", $user, $password);
|
|
||||||
echo "Connected successfully<br>";
|
|
||||||
|
|
||||||
$prepare = $connection->prepare("SELECT cognome, nome, note FROM pazienti");
|
|
||||||
$prepare->execute();
|
|
||||||
if ($prepare->rowCount() > 0) {
|
|
||||||
$datiPazienti = $prepare->fetchAll();
|
|
||||||
}
|
|
||||||
$connection = null;
|
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
die ("Error!: " . $e->getMessage() . "<br/>");
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
<html>
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<title>HTML</title>
|
|
||||||
<style>
|
|
||||||
#customers {
|
|
||||||
font-family: Arial, Helvetica, sans-serif;
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
#customers td, #customers th {
|
|
||||||
border: 1px solid #ddd;
|
|
||||||
padding: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#customers tr:nth-child(even) {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
}
|
|
||||||
|
|
||||||
#customers tr:hover {
|
|
||||||
background-color: #ddd;
|
|
||||||
}
|
|
||||||
|
|
||||||
#customers th {
|
|
||||||
padding-top: 12px;
|
|
||||||
padding-bottom: 12px;
|
|
||||||
text-align: left;
|
|
||||||
background-color: #04AA6D;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<table>
|
|
||||||
<tr id="customers">
|
|
||||||
<th>Cognome</th>
|
|
||||||
<th>Nome</th>
|
|
||||||
<th>Note</th>
|
|
||||||
</tr>
|
|
||||||
<?php foreach ($datiPazienti as $row) {
|
|
||||||
echo '<tr>';
|
|
||||||
echo '<td>' . htmlspecialchars($row['cognome']) . '</td>';
|
|
||||||
echo '<td>' . htmlspecialchars($row['nome']) . '</td>';
|
|
||||||
echo '<td>' . htmlspecialchars($row['note']) . '</td>';
|
|
||||||
echo '</tr>';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
Loading…
Add table
Reference in a new issue