I have a large form that can be built dynamically, user can add multiple fields and now I have problems with saving values to DB.
I'm using codeigniter.
This is my form

and this is part of my controller that handle those inputs:
$from = array();
foreach ($this->input->post('from') as $froms)
{
$from[] = $froms;
}
$to = array();
foreach ($this->input->post('to') as $tos)
{
$to[] = $tos;
}
$step = array();
foreach ($this->input->post('step') as $steps)
{
$step[] = $steps;
}
$odvisnost = array();
foreach ($this->input->post('odvisnost') as $dependency)
{
$odvisnost[] = $dependency;
}And I get error:
A PHP Error was encountered
Severity: Notice
Message: Array to string conversion
Filename: mysql/mysql_driver.php
Line Number: 552
and
A Database Error Occurred
Error Number: 1054
Unknown column 'Array' in 'field list'
INSERT INTO `gc_dioptry` (`produkt`, `from`, `to`, `step`, `dependancy`, `value`) VALUES ('1', '2', '3', Array, Array, Array)
Filename: C:\xampp\htdocs\leckacms\system\database\DB_driver.php
Line Number: 330
1st value is "productid"
As you can see it tries to insert 'array' instead of values that I enter, I entered 2,3,4,5 and 6.
My html form is correct with all inputs names as array[] for example:
<input type="text" name="steps[]">











