mirror of
https://github.com/Floriansylvain/projet_programmation_web.git
synced 2026-08-19 19:53:18 +02:00
🎨 Cleaning getTheseByAuthor
This commit is contained in:
@@ -21,13 +21,13 @@ class dump {
|
|||||||
|
|
||||||
$pdo = new PDO('mysql:host=localhost;dbname=projet_prog_web;charset=utf8', 'root', 'root');
|
$pdo = new PDO('mysql:host=localhost;dbname=projet_prog_web;charset=utf8', 'root', 'root');
|
||||||
$stmt = $pdo->query("SELECT * FROM theses WHERE author = '$author';");
|
$stmt = $pdo->query("SELECT * FROM theses WHERE author = '$author';");
|
||||||
while ($obj = $stmt->fetchObject()) {
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$theses_array[`$i`] = array();
|
while ($obj = $stmt->fetchObject()) {
|
||||||
|
$theses_array[$i] = array();
|
||||||
foreach ($obj as $elem) {
|
foreach ($obj as $elem) {
|
||||||
array_push($theses_array[`$i`], empty($elem) ? "NULL" : $elem);
|
array_push($theses_array[$i], empty($elem) ? "NULL" : $elem);
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $theses_array;
|
return $theses_array;
|
||||||
|
|||||||
Reference in New Issue
Block a user