Welcome Guest, Not a member yet? Register   Sign In
insert_batch() not working completely
#7

If that is the problem the the solution should be easy.

Looking at your arrays, each weekday is a column within the table

So just add every weekday to the arrays and fill in the values where they should go

Code:
Array
(
[0] => Array
  (
      [trainer_id] => 2
      [plan_id] => 2
      [week] => week1
      [mon] => {"time":"1:00 AM","item":"a","description":"a"}
      [tue] => ""
      [wed] => ""
      [thu] => ""
      [fri] => ""
      [sat] => ""
      [sun] => ""
      [created_at] => 2017-04-11 13:17:27
      [updated_at] => 2017-04-11 13:17:27
  )
[1] => Array
  (
      [trainer_id] => 2
      [plan_id] => 2
      [week] => week2
      [mon] => ""
      [tue] => {"time":"1:00 AM","item":"b","description":"b"}
      [wed] => ""
      [thu] => ""
      [fri] => ""
      [sat] => ""
      [sun] => ""
      [created_at] => 2017-04-11 13:17:27
      [updated_at] => 2017-04-11 13:17:27
  )

[2] => Array
  (
      [trainer_id] => 2
      [plan_id] => 2
      [week] => week3
      [mon] => ""
      [tue] => ""
      [wed] => {"time":"1:00 AM","item":"d","description":"d"}
      [thu] => ""
      [fri] => ""
      [sat] => ""
      [sun] => ""
      [created_at] => 2017-04-11 13:17:27
      [updated_at] => 2017-04-11 13:17:27
  )

[3] => Array
  (
      [trainer_id] => 2
      [plan_id] => 2
      [week] => week4
      [mon] => ""
      [tue] => ""
      [wed] => ""
      [thur] => {"time":"1:00 AM","item":"d","description":"d"}
      [fri] => ""
      [sat] => ""
      [sun] => ""
      [created_at] => 2017-04-11 13:17:27
      [updated_at] => 2017-04-11 13:17:27
  )
)
Reply


Messages In This Thread
RE: insert_batch() not working completely - by Martin7483 - 04-24-2017, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB