Link to home
Start Free TrialLog in
Avatar of Coast Line
Coast LineFlag for Canada

asked on

looping over JSON Object and insert into query

Hi, I have the following JSON Object and i am trying to insert into the database:

try to find a simple way so loop over and it keeps on inserting and append the messages in the variable:

more important are the values which are inside the data say :
0
1
2
3
4
5
6
7
8 and its nested values

here is the attached JSON

{
   "status":"OK",
   "data":{
      "group_id":1522413460,
      "0":{
         "id":"1522413460-1",
         "customid":"",
         "customid1":"",
         "customid2":"",
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "1":{
         "id":"1522413460-2",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "2":{
         "id":"1522413460-3",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "3":{
         "id":"1522413460-4",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"",
         "status":"INV-NUMBER"
      }
   },
   "message":"Campaign of 4 numbers Submitted successfully."
}

Open in new window

Avatar of Mr_Nil
Mr_Nil
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you tried using the deserializeJSON function?
ASKER CERTIFIED SOLUTION
Avatar of Mr_Nil
Mr_Nil
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Coast Line

ASKER

i will check today