Insert database rows from columns of data from associative array of indexed arrays
<p>I have an array called <code>$works</code> which looks like this:</p>
<pre><code>[
    'type' =&gt; [1, 5],
    'description' =&gt; [2, 6],
    'hours' =&gt; [3, 7],
    'amount' =&gt; [4, 8]
]
</code></pre>
<p>I need to send all values to Database (MySQL) in two iterations. Something like:</p>
<pre><code>INSERT INTO `works` (`type`, `description`, `hours`, `amount`) VALUES (works[type][0], works[decsription][0], works[hours][0], works[amount][0]);

INSERT INTO `works` (`type`, `description`, `hours`, `amount`) VALUES (works[type][1], works[description][1], works[hours][1], works[amount][1]);
</code></pre>