Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to extract JSON data from a file and update a database with the data that i extracted from my file.
The code bellow represents my JSON data simplified :
{ "data": { "uniqueIdData": "1", "datecreat": "2019-09-23", "libelle": "Septembre 2019", "user": "user.user@user.com", "date": "2019-09-23 00:00:00", "user": [ { "uniqueId": "1", "expenseDate": "2019-09-23", "categoryName": "Car", "categoryType": "Car", "approb": [ { "lvl": 1, "user": "user1.user@user.com", "date": "2019-09-26 00:00:00" } ], "verif_user": "user2.user@usercom", "verif_date": "2019-09-26 00:00:00", "compta_user": "user3.user@user.com", "compta_date": "2019-09-30 00:00:00", "code_projet": "PROJECTX" }, { "uniqueId": "2", "expenseDate": "2019-09-24", "categoryName": "Fuel", "categoryType": "Fuel", "approb": [ { "niv": 1, "user": "user2.user@user.com", "date": "2019-09-26 00:00:00" } ], "verif_user": "user2.user@user.com", "verif_date": "2019-09-26 00:00:00", "compta_user": "user3.user@user.com", "compta_date": "2019-10-05 00:00:00", "code_projet": "PROJECTY" } ] } }
As you cans see the are 3 levels data => users => aprob.
What i have :
What i want to have :