diff --git a/api-rest/dbConnection.php b/api-rest/dbConnection.php
new file mode 100644
index 0000000..fe9c710
--- /dev/null
+++ b/api-rest/dbConnection.php
@@ -0,0 +1,57 @@
+connect_error) {
+ echo 'Errno: '.$mysqli->connect_errno;
+ echo '
';
+ echo 'Error: '.$mysqli->connect_error;
+ exit();
+ }
+
+
+ echo '
';
+ echo 'Host information: '.$mysqli->host_info;
+ echo '
';
+ echo 'Protocol version: '.$mysqli->protocol_version;
+
+ $mysqli->close();
+
+ try{
+ $dbh = new PDO($db_dsn,$db_user,$db_password);
+ $dbh->exec("set names utf8");
+ echo 'Success: A proper connection to MySQL was made.';
+ }catch(PDOException $exception){
+ echo "Connection error : " . $exception->getMessage();
+ }
+ */
+ class Database{
+ public $connection;
+
+ public function establishConnection(){
+ $this->connection=null;
+
+ try{
+ $this->connection = new PDO("mysql:dbname=bobParty;host=127.0.0.1;port=8889", "root", "root");
+ $this->connection->exec("set names utf8");
+ }catch(PDOException $exception){
+ echo "Connection error : " . $exception->getMessage();
+ }
+
+ return $this->connection;
+ }
+ }
+?>
\ No newline at end of file
diff --git a/api-rest/models/User.php b/api-rest/models/User.php
new file mode 100644
index 0000000..dbb45aa
--- /dev/null
+++ b/api-rest/models/User.php
@@ -0,0 +1,30 @@
+connection=$db;
+ }
+
+ public function read(){
+ $sqlQuery= "SELECT U.id, U.username, U.password, U.nationality, U.sex, U.dateOfBirth, U.currentBobCoins, U.totalBobCoins, U.nbGamesPlayed FROM User U";
+ $query = $this->connection->prepare($sqlQuery);
+ $query->execute();
+ return $query;
+ }
+}
+
+?>
\ No newline at end of file
diff --git a/api-rest/users/read.php b/api-rest/users/read.php
new file mode 100644
index 0000000..ab964c6
--- /dev/null
+++ b/api-rest/users/read.php
@@ -0,0 +1,55 @@
+ "Unauthorized method"]);
+}else{
+ include_once '../dbConnection.php';
+ include_once '../models/User.php';
+
+ $db= new Database();
+ $db= $db->establishConnection();
+
+ $user = new User($db);
+
+ $stmt = $user->read();
+
+ if($stmt->rowCount() >= 0){
+
+ $arrayUser=[];
+ $arrayUser['users']=[];
+
+ while($row = $stmt->fetch(PDO::FETCH_ASSOC)){
+ extract($row);
+
+ $user= [
+ "id" => $id,
+ "username" => $username,
+ "password" => $password,
+ "nationality" => $nationality,
+ "sex" => $sex,
+ "dateofBirth" => $dateOfBirth,
+ "currentBobCoins"=>$currentBobCoins,
+ "totalBobCoins" => $totalBobCoins,
+ "nbGamesPlayed" => $nbGamesPlayed,
+ ];
+
+ $arrayUser['users'][]=$user;
+ }
+
+ http_response_code(200);
+
+ echo json_encode($arrayUser);
+
+ }
+}
+
+?>
\ No newline at end of file