NYCPHP Meetup

NYPHP.org

[nycphp-talk] JSON and MVC

Daniel Convissor danielc at analysisandsolutions.com
Sat Jul 18 11:20:24 EDT 2009


Hello again:

> $result = <execute $sql>;
> 
> $out = array();
> foreach ($result as $row) {
>     $out[$row['loan_id']] = $row;
> }
> 
> echo json_encode($out);

Oh, make that:
     $out[$row['loan_id']][] = $row;

:/

--Dan

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list