Here\'s my PHP code called during jQuery AJAX call:
json_encode accepts objects, so there's no need to do that automatic array-building.:
json_encode
$row = $result->fetch_object(); echo json_encode($row);
It's as simple as that!