I had a script for this that worked great in PHP 5.3. New host only supports 5.5 so I\'ve done some modifying. So far, I can only get one row to be returned. I\'ve been agonisin
Your $row_array
replaces every time and you get the last one. change your code to:
$i = 0;
while ($row = mysqli_fetch_assoc($result)) {
$row_array[$i]['title'] = $row['title'];
$row_array[$i]['year'] = $row['year'];
$row_array[$i]['author'] = $row['author'];
$row_array[$i]['journal'] = $row['journal'];
$row_array[$i]['keywords'] = $row['keywords'];
$row_array[$i]['abstract'] = $row['abstract'];
$row_array[$i]['url'] = $row['url'];
$i++;
}
echo '{"data":';
echo json_encode($row_array);
echo '}';