Convertir nuestros registros MySQL a JSON

{
    "postres": [
        {
            "id": "1",
            "nombre": "Torta de Chocolate",
            "stock": "35",
            "precio": "5.00",
            "url": "torta-de-chocolate",
            "img": "tc.jpg",
            "fecha": "2019-06-17 15:56:23"
        },
        {
            "id": "2",
            "nombre": "Pie de Manzana",
            "stock": "45",
            "precio": "4.50",
            "url": "pie-de-manzana",
            "img": "pm.jpg",
            "fecha": "2018-08-11 16:25:33"
        },
        {
            "id": "3",
            "nombre": "Arroz con Leche",
            "stock": "36",
            "precio": "2.50",
            "url": "arroz-con-leche",
            "img": "al.jpg",
            "fecha": "2018-08-11 16:25:36"
        },
        {
            "id": "4",
            "nombre": "Gelatina de Fresa",
            "stock": "60",
            "precio": "1.50",
            "url": "gelatina-de-fresa",
            "img": "gf.jpg",
            "fecha": "2018-08-11 16:25:39"
        },
        {
            "id": "5",
            "nombre": "Suspiro a la Lime\u00f1a",
            "stock": "26",
            "precio": "6.00",
            "url": "suspiro-a-la-lime\u00f1a",
            "img": "sl.jpg",
            "fecha": "2019-06-17 15:58:43"
        },
        {
            "id": "6",
            "nombre": "Mazamorra Morada",
            "stock": "50",
            "precio": "3.00",
            "url": "mazamorra-morada",
            "img": "mm.png",
            "fecha": "2018-08-11 16:25:45"
        }
    ]
}