[eluser]OverZealous[/eluser]
My examples are horrible, I just realized. Doh!
You see NULLs because Area didn't load any data.
Use it like this:
Code:
$a = new Area();
$a->get(); // or whatever
echo $a->to_json(array('id', 'stNome'), TRUE);
Also, the next update of DMZ includes an additional method for the json extension: all_to_json, which converts all of the results in ->all into a JSON array. I've also included an extension for converting to and from associative arrays.