I'm trying to get returned results from a MySQL table, when i encode
echo json_encode($result);
and I use javascript to grab it...
$.ajax({
url: "helpers/data.php",
type: "GET",
dataType:"json",
success: function(returnData){
document.write(returnData);
}
this is what it returns...
[object Object],[object Object],[object Object],[object Object]
I can fix it temp by doing this...
echo json_encode(json_encode($result));
and then it returns the correct array...
but using the same jquery it returns the variable as undefined