CodeIgniter Forums
Retriving data from a db with an Ajax call - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Retriving data from a db with an Ajax call (/showthread.php?tid=56731)



Retriving data from a db with an Ajax call - El Forum - 01-15-2013

[eluser]GabrieleMartino[/eluser]

The controller is simple

Code:
public function video_download ($page_id){
            header('Content-Type: application/x-json; charset=utf-8');
            $to_share = $this->chats_model->catch_shared_video($page_id);
            return json_encode($to_share);
}





Retriving data from a db with an Ajax call - El Forum - 01-15-2013

[eluser]GabrieleMartino[/eluser]
The answer is that is just

Code:
echo json

and not return