This question is very similira to this one but with a little twist to it. I have an array that looks like this:
Array
(
[0] => Array
(
[post_id] => 5410
[Issue] => 2010
[_Issue] => field_573d7fa8454e9
[_volume] => field_573d7f79ef9ab
[volume] => 530
[_journals] => field_56d3de5ddc04d
[pages] => 105-9
[authors] => Onger, M., Jaluth, K.
[_publication_date] => field_5729cc7e5b832
[publication_date] => Jan 17
[_banner_text] => field_56cfed156f70a
[_link_to_pubmed] => field_573d7fe145230
[_authors] => field_56d3de4edc04c
[journals] => Nature Medicine
[url] =>
[_url] => field_56dd48d6ee6bb
[_assign_multiple] => field_570f3b71e3c3f
[banner_text] =>
[assign_multiple] => 0
[_pages] => field_573d7fbe06a50
[link_to_pubmed] => http://www.ncbi.nlm.nih.gov/pubmed/1
)
[1] => Array
(
[post_id] => 5411
[Issue] =>
[_Issue] => field_573d7fa8454e9
[_volume] => field_573d7f79ef9ab
[volume] =>
[_journals] => field_56d3de5ddc04d
[pages] =>
[authors] => Kingangi, M. J., Dingo, C.
[_publication_date] => field_5729cc7e5b832
[publication_date] => Feb 6
[_banner_text] => field_56cfed156f70a
[_link_to_pubmed] => field_573d7fe145230
[_authors] => field_56d3de4edc04c
[journals] => Molecular Biology and Evolution
[url] =>
[_url] => field_56dd48d6ee6bb
[_assign_multiple] => field_570f3b71e3c3f
[banner_text] =>
[assign_multiple] => 0
[_pages] => field_573d7fbe06a50
[link_to_pubmed] => http://www.ncbi.nlm.nih.gov/pubmed/2
)
The table that i want to insert this data is like this (see below)
+------------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------------+------+-----+---------+----------------+
| meta_id | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
| post_id | bigint(20) unsigned | NO | MUL | 0 | |
| meta_key | varchar(255) | YES | MUL | NULL | |
| meta_value | longtext | YES | | NULL | |
+------------+---------------------+------+-----+---------+----------------+
Unlike the situation described in the link above, i need to insert the keys and their values in 'meta_key' and 'meta_value' for each array. I have been cracking my head trying to figure this out