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

The data is inteded to appear like this in the table

+---------+---------+-------------------+-----------------------+
| meta_id | post_id | meta_key          | meta_value            |
+---------+---------+-------------------+-----------------------+
|  190143 |    5318 | _Issue            | field_573d7fa8454e9   |
|  190142 |    5318 | Issue             | 6                     |
|  190141 |    5318 | _volume           | field_573d7f79ef9ab   |
|  190140 |    5318 | volume            | 198                   |
|  190139 |    5318 | _journals         | field_56d3de5ddc04d   |
|  190144 |    5318 | pages             | 1192-100              |
|  190136 |    5318 | authors           | Onger, M., Jaluth, K. |
|  190135 |    5318 | _publication_date | field_5729cc7e5b832   |
|  190134 |    5318 | publication_date  | 17 January 2016       |
|  190131 |    5318 | _banner_text      | field_56cfed156f70a   |
|  190147 |    5318 | _link_to_pubmed   | field_573d7fe145230   |
|  190137 |    5318 | _authors          | field_56d3de4edc04c   |
|  190138 |    5318 | journals          | Nature Medicine       |
|  190132 |    5318 | url               |                       |
|  190133 |    5318 | _url              | field_56dd48d6ee6bb   |
|  190129 |    5318 | _assign_multiple  | field_570f3b71e3c3f   |
|  190130 |    5318 | banner_text       |                       |
|  190128 |    5318 | assign_multiple   | 0                     |
|  190145 |    5318 | _pages            | field_573d7fbe06a50   |
|  190146 |    5318 | link_to_pubmed    |                       |
+---------+---------+-------------------+-----------------------+

From the above table you can see that the keys and the values have been entered in the table

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.