How to handle a array response from .getjson. Following code handles ajax request.
function getinfo()
{
$query="select field_uname_value,field_uaddress_value,field_uphone_value from {content_type_udetails}";
$result= db_query($query);
$i=0;
while($item = db_fetch_object($result))
{
$info[$i++]=array($item->field_uname_value,$item->field_uaddress_value,$item->field_uphone_value);
}
print_r($info);
}
and returns array as follows
Array
(
[0] => Array
(
[0] => bharath
[1] => 12th street ,ram nagar
[2] => 213124442
)
[1] => Array
(
[0] => Christina
[1] => 77,five corner
[2] => 76874323
)
[2] => Array
(
[0] => Ranjan
[1] => queen towers, 4th layout
[2] => 45745747
)
)
but following ajax handling not works. how to get the array response
$.getJSON('/knpgetuserinfo.json×tamp'+new Date().getTime(), function(data) {
alert(data[0][0]);
}