From b0547ee0ee755634c4f5b3f816146eb5116d35d3 Mon Sep 17 00:00:00 2001 From: Florian SYLVAIN Date: Fri, 24 Sep 2021 11:39:30 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Cleaning=20getTheseByAuthor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjetProgWeb/class/dump.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ProjetProgWeb/class/dump.php b/ProjetProgWeb/class/dump.php index 2059e25..902bbe0 100644 --- a/ProjetProgWeb/class/dump.php +++ b/ProjetProgWeb/class/dump.php @@ -21,13 +21,13 @@ class dump { $pdo = new PDO('mysql:host=localhost;dbname=projet_prog_web;charset=utf8', 'root', 'root'); $stmt = $pdo->query("SELECT * FROM theses WHERE author = '$author';"); + $i = 0; while ($obj = $stmt->fetchObject()) { - $i = 0; - $theses_array[`$i`] = array(); + $theses_array[$i] = array(); foreach ($obj as $elem) { - array_push($theses_array[`$i`], empty($elem) ? "NULL" : $elem); - $i++; + array_push($theses_array[$i], empty($elem) ? "NULL" : $elem); } + $i++; } return $theses_array;