Hi I have the following JSON data ,fetched from my database:
[{
"0": "1",
"id": "1",
"1": "Hakob",
"name": "Hakob",
"2": "abc@email.com",
"email": "abc@email.com"
}, {
"0": "2",
"id": "2",
"1": "Arsen",
"name": "Arsen",
"2": "zxc@email.com",
"email": "zxc@email.com"
}]
I don't want to see the following key/values "0": "1","1": "Hakob","2": "abc@email.com",
and same for other row.
Who does now what are they, and how I can remove them.
Here is my PHP script for getting this thing
$sql = "SELECT * FROM contacts";
$result = mysqli_query($connect, $sql);
$response = array();
while ($row = mysqli_fetch_array($result)) {
$response[] = $row;
}
print json_encode($response);
// Close connection
mysqli_close($connect);