$responses = array();
while ($row = mysql_fetch_array($result)) {
$response = array(
'name' => $row['name']
);
$row;
$responses['name5'] = $response;
}
echo json_encode($responses);
I’m currently only getting 1 rows from this statement I know for a fact their are more.
On each iteration of your while loop, you are overwriting the same array key
$responses['name5'], so in the end you’ll only have one value in the$responsesarray.Instead, you might want something like this to append to the end of the array: