Field names in json

(2 posts) (2 voices)

Tags:

No tags yet.

  1. maron, Member

    I am using the export=json option which renders vaild json array without field names.

    Is it possible to return a json object including field names instead?

    I want this

    { "first": "Jimmy", "last": "James", "age": 29, "sex": "M", "salary": 63000, "registered": false }

    But I get this

    [["Jimmy","James",29,"M",63000,false]]

    Regards, Maron

  2. myDBR Team, Key Master

    Hi,
    yes, you can either add "&json_force_object=1" to the URL or add definition:

    $mydbr_defaults['export']['json']['force_object'] = true;

    to the mydbr/user/defaults.php.

    The object fields are either column names or if you have defined column references, myDBR will use those.

    --
    myDBR Team


Reply

You must log in to post.