From a2e6611d97ddee58227faab712bbb6a5d193ce58 Mon Sep 17 00:00:00 2001 From: Christophe H <65390576+christophe-havard-sonarsource@users.noreply.github.com> Date: Wed, 2 Feb 2022 11:38:09 +0100 Subject: [PATCH] Create sqlquery.php --- sqlquery.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sqlquery.php diff --git a/sqlquery.php b/sqlquery.php new file mode 100644 index 00000000..069d9a25 --- /dev/null +++ b/sqlquery.php @@ -0,0 +1,22 @@ +get('id'); + $sql = "SELECT email FROM user WHERE id='$userId'"; + $statement = $this->connection->prepare($sql); + $statement->execute(); + $username = $statement->fetchColumn(); + return $this->json(['email' => $username]); + } +} +?>