From 2578b4b1341acf6ca43aa09eb67e6b3869241267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20BOUHOURS?= Date: Mon, 9 Jan 2023 22:12:37 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'api-rest/index.php?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-rest/index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api-rest/index.php b/api-rest/index.php index d61ccc1..34cd273 100644 --- a/api-rest/index.php +++ b/api-rest/index.php @@ -1,4 +1,14 @@ query("CREATE TABLE `coucou` (`COUCOU_ID` int(10) unsigned NOT NULL AUTO_INCREMENT,`COUCOU_TEXT` char(10) NOT NULL);"); + $conn->query("INSERT INTO `coucou` VALUES('TOTO');"); + $res = $conn->query("SELECT * FROM coucou"); + while ($une_valeur = $res->fetch_assoc()) { + echo $une_valeur["COUCOU_ID"]." ".$une_valeur["COUCOU_TEXT"]; + } + exit; + + header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: POST,GET,DELETE,PUT');