0
array(2) {
  [0]=>
  array(1) {
    ["url_id"]=>
    string(2) "45"
  }
  [1]=>
  array(1) {
    ["h"]=>
    string(1) "3"
  }
}

echo $column_list = join(',', $items);
...

This PDO Insert Array Using Key As Column Name helps me inserting array values in MySQL table easily. But now I do have an array containing subarrays and it looks like this join(',', $items); does not work. Guess you think "of course it doesn't work" right now, but how can I store the keys and the values into a variable to use $sql = "INSERT INTO applications ($column_list) VALUES ($param_list)"; successfully.

I have tried array_merge but that did not work at all. I would like to show some code examples, but I have no idea what to try and how to achieve that.

Thanks for your help! I appreciate it!

Robin Alexander
  • 984
  • 2
  • 13
  • 29

0 Answers0