diff --git a/ProjetProgWeb/api.php b/ProjetProgWeb/api.php new file mode 100644 index 0000000..3c140d3 --- /dev/null +++ b/ProjetProgWeb/api.php @@ -0,0 +1,13 @@ +'; +var_dump($json); +echo ''; diff --git a/ProjetProgWeb/class/dump.php b/ProjetProgWeb/class/dump.php index 468d1f3..2059e25 100644 --- a/ProjetProgWeb/class/dump.php +++ b/ProjetProgWeb/class/dump.php @@ -1,5 +1,7 @@ query("SELECT * FROM theses WHERE author = '$author';"); + while ($obj = $stmt->fetchObject()) { + $i = 0; + $theses_array[`$i`] = array(); + foreach ($obj as $elem) { + array_push($theses_array[`$i`], empty($elem) ? "NULL" : $elem); + $i++; + } + } + + return $theses_array; + } + public function sendThese() { $data = [ 'author' => $this->these->getAuthor(), @@ -39,5 +58,4 @@ class dump { $stmt= $pdo->prepare($sql); $stmt->execute($data); } - } \ No newline at end of file