I have a JSON data get from an API and I want to get/access for each AttributeValues the code
and values
to store into the tables, code as tables columns and values are dynamic for each record. I don't need to store the Attachements and Total from the json values.
i want to store to tables as an insert into (ID, TrackingNumber, CustomerFull) values (json values). any codeigniter, or php soluton or hint will be much appricate.
{
"Values": [{
"AttributeValues": [{
"ID": 0,
"Name": "ID",
"Values": [
"720"
],
"DataType": "Number",
"Code": "ID",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Tracking Number",
"Values": [
"xxxx/1094/180730/1"
],
"DataType": "String",
"Code": "TrackingNumber",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Customer Full",
"Values": [
"Ali Abdi"
],
"DataType": "String",
"Code": "CustomerFull",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
}
],
"Attachements": null
},
{
"AttributeValues": [{
"ID": 0,
"Name": "ID",
"Values": [
"757"
],
"DataType": "Number",
"Code": "ID",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Tracking Number",
"Values": [
"xxx/1094/180731/1"
],
"DataType": "String",
"Code": "TrackingNumber",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Customer Full",
"Values": [
"Aberash Haile"
],
"DataType": "String",
"Code": "CustomerFull",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Service Code",
"Values": [
"SO-1096"
],
"DataType": "String",
"Code": "ServiceCode",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
},
{
"ID": 0,
"Name": "Request Date",
"Values": [
"7/31/2018 11:04:06 AM"
],
"DataType": "Datetime",
"Code": "RequestDate",
"IsVisible": true,
"IsValueEmptyOrNull": false,
"IsDefault": true
}
],
"Attachements": null
}
],
"Total": 335
}