Welcome Guest, Not a member yet? Register   Sign In
going from json_decode to insert_batch
#5

(This post was last modified: 04-16-2018, 10:24 AM by richb201.)

Thanks.  I just tried casting:

$Arr=(array)$json[1];

This seems to make a long 1-d array of the values.

Then to decant it I use

          for ($i = 0;$i <= 13;$i++)
           {
              $date=$Arr[$i*5+0];
              $busc=$Arr[$i*5+1];
              $proj=$Arr[$i*5+2];
              $act=$Arr[$i*5+3];
              $email=$email_key;
               $logdata[0]=$date;
              $logdata[1]=$busc;
              $logdata[2]=$proj;
              $logdata[3]=$act;
              $logdata[4]=$email;
              //here is where I will 
          //  this->db->insert('activity_log',$logdata);
            }
The strange thing is busc which should be "choose" seems to be returning null. I am using that same buffer as above. Unless there is some more direct way to get this data into table? seems like it will be slow.
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: going from json_decode to insert_batch - by richb201 - 04-16-2018, 10:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB