[eluser]davidbehler[/eluser]
Each time you go through your foreach-loop, you assign a new array to $data instead of adding the array to the existing content of $data. Easy fix:
Replace this
Code:
$data = array(
"id" => $row['id'],
"a_name" => $row['a_title'],
"a_description" => $row['a_description'],
"a_image" => $row['a_image']
);
with this
Code:
$data[] = array(
"id" => $row['id'],
"a_name" => $row['a_title'],
"a_description" => $row['a_description'],
"a_image" => $row['a_image']
);
or even easier instead of the foreach-loop, simply do this:
Code:
$data = $Q->result_array();