Well, this is my code:
<?php
header("Content-Type:application/json");
include('connection.php');
$query = "SELECT * FROM users";
$result = mysqli_query($con,$query);
while ($row = mysqli_fetch_array($result,MYSQLI_ASSOC)){
$customerData['id'] = $row['id'];
$customerData['username'] = $row['username'];
$customerData['password'] = $row['password'];
$customerData['created'] = $row['created_at'];
$response["users"] = $customerData;
}
echo json_encode($response); exit;
?>
Currently I have two users in my database. What this code should do is to display all users in my database. At the moment the code works only so that only one user is shown. Does someone know what I have to change? Thanks in advise.