I have an array called $works
which looks like this:
[
'type' => [1, 5],
'description' => [2, 6],
'hours' => [3, 7],
'amount' => [4, 8]
]
I need to send all values to Database (MySQL) in two iterations. Something like:
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]);