I have json_encoded an array of a mysql result as shown here:
$allquery="SELECT * FROM wp_users";
$names = array();
$allresult=mysql_query($allquery) or die(mysql_error()); ?>
<?php while($rows=mysql_fetch_array($allresult)){
$names[] = $rows['display_name'];
}
print json_encode( array(
"res" => $names,
"fvdfvv" => "sdfsd"
)
);
My problem is... when it gets back to the client-side, I am unsure about how to display it. I try and alert the reply on success:
success: function(result){
var allresult = result.res
$('#result').html( allresult );
alert(allresult);
//$("#notice_div").hide();
}
But this doesnt return anything. In fact, the success handler doesnt even begin.
Any ideas?
Thanks