From c4c562ced45702b739e2c52a06cacee127c3c9e3 Mon Sep 17 00:00:00 2001 From: filippo.bertilotti <filippobertilotti@gmail.com> Date: Fri, 03 May 2024 12:36:48 +0200 Subject: [PATCH] fine parte 7 --- index.php | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/index.php b/index.php index e69de29..2ca28b7 100644 --- a/index.php +++ b/index.php @@ -0,0 +1,12 @@ +<?php + $dns = "mysql:host=localhost;dbname=product_db;charset=utf8;port=3306"; + $pdo = new PDO($dns, "product_db_user", "secret", [ + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION + ]); + + $stmt = $pdo->query("SELECT * FROM product"); + + $products = $stmt->fetchAll(PDO::FETCH_ASSOC); + + print_r($products); +?> \ No newline at end of file -- Gitblit v1.8.0