Welcome Guest, Not a member yet? Register   Sign In
Query to json - HELP
#2

[eluser]ojcarga[/eluser]
I don´t know if that is possible, but I´d do it this way,

Code:
$this->output
    ->set_content_type('application/json')
    ->set_output(json_encode(array('foo' => 'bar')));

array('foo' => 'bar') is the array containing the data retrieved from the database.

http://ellislab.com/codeigniter/user-gui...utput.html


Messages In This Thread
Query to json - HELP - by El Forum - 05-01-2012, 10:44 AM
Query to json - HELP - by El Forum - 05-01-2012, 11:22 AM
Query to json - HELP - by El Forum - 05-01-2012, 11:27 AM
Query to json - HELP - by El Forum - 05-01-2012, 11:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB