FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Json result
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Json result [message #175720] Sat, 22 October 2011 19:02 Go to previous message
Sarah is currently offline  Sarah
Messages: 30
Registered: December 2010
Karma:
Member
Hi! I had a page for generate an XML file, now I'm trying to change it
for return JSON file

in $result I've my query

while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {

$data['locations'][] = $row;
}

Header('Content-type: application/json');
echo json_encode($data);
exit;


When I try to exevcute this page browser ask me to download the page
and if I insert

echo '----';
print_r($data['locations']);
print_r($data);
die;
Header('Content-type: application/json');
echo json_encode($data);
exit;


I show only '---'

Can you help me??

Thanks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Import values reading from XML nodes
Next Topic: PHP Extension Namespaces
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 12:39:02 GMT 2024

Total time taken to generate the page: 0.04140 seconds