From 35a67d4fc7f70b6c131e04a784a4a28d653b06f4 Mon Sep 17 00:00:00 2001 From: Andrea Date: Mon, 20 Jan 2025 08:35:51 +0100 Subject: [PATCH] PDO Connection --- pdo/index.php | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 pdo/index.php diff --git a/pdo/index.php b/pdo/index.php new file mode 100644 index 0000000..02afd54 --- /dev/null +++ b/pdo/index.php @@ -0,0 +1,80 @@ +"; + + $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() . "
"); +} +?> + + + + + HTML + + + + + + + + + + + '; + echo ''; + echo ''; + echo ''; + echo ''; + } + ?> +
CognomeNomeNote
' . htmlspecialchars($row['cognome']) . '' . htmlspecialchars($row['nome']) . '' . htmlspecialchars($row['note']) . '
+ + +