0

I would like to create a JSON output from those to tables to look like this:

I am trying to build a json output from two related MySQL tables. I have a table of "Restaurants" and table "Dishes" each item in Restaurants table has several relative items in the Dishes table which are referenced by id. Each Restaurant item ID is a foreign key in the Dishes table as f_id.

{
"Restaurants": [
    {
        "name": "String content",
        "misc info": "String content"
        "Dishes": [
            {
                "dish": "String content",
                "description": "String content"

            },
            {
                "dish": "String content",
                "description": "String content"
            }
        ],

    },
    {
        "name": "String content",
        "misc info": "String content"
        "Dishes": [
            {
                "dish": "String content",
                "description": "String content"
            },
            {
                "dish": "String content",
                "description": "String content"
            }
        ],

    }
]

}

5

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.