This is my Json object for products which is stored in database. This json object is also storing another json object with images.
1.question: Is this the correct way of storing data about products in database or should be images stored separately?
2.question: Is format of this json object correct, i'm especially interested in sub json "images"?
3.question: How should JSON object look like if sub Json "images" would have like some json index array, where index would be the position of image
{
"id_product": "1000",
"name": "Rippin Unions",
"description": "Vel aut sed neque enim illum mollitia. Molestias aperiam qui dolorem qui est. Dolore cumque dolore formatedtempore ipsum. Veniam molestiae laudantium voluptates numquam.",
"date_c": "2015-12-31 02:06:32",
"date_u": null,
"id_category": "46",
"id_user": "123",
"alias": "rippin-unions",
"active": "1",
"images": "[
{thumbImage:"http://lorempixel.com/250/150/?27403",image:"http://lorempixel.com/1024/768/?28526",position:4},
{thumbImage:"http://lorempixel.com/250/150/?25207",image:"http://lorempixel.com/1024/768/?73566",position:1},
{thumbImage:"http://lorempixel.com/250/150/?26960",image:"http://lorempixel.com/1024/768/?72686",position:0},
{thumbImage:"http://lorempixel.com/250/150/?25168",image:"http://lorempixel.com/1024/768/?22297",position:2},
{thumbImage:"http://lorempixel.com/250/150/?94897",image:"http://lorempixel.com/1024/768/?94418",position:3}
]"
}
I'm askin this because currently i have problems printing JSON data.
All i can do is call products[0].images, but if i try to select first thumb picture i fail. i Have tried many variations and nothing is working
If you need any additional question, please let me know and i will provide.
Thanks in advance
"images": [{thumbImage: "..."}, ...]. Then you can access the first image withproducts[0].images[0].