🎨 Cleaning getTheseByAuthor

This commit is contained in:
Florian SYLVAIN
2021-09-24 11:39:30 +02:00
parent 8da075290d
commit b0547ee0ee
+4 -4
View File
@@ -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;