[eluser]chejnik[/eluser]
Hello,
I wrote it wrongly. The query returns a column (not a row). Thats why it is needed result_array not row_array.
Code:
function selectStructure($i)
{
$tableSettings ='databaseSettings'.$i;
// collate is missing
$this->db->select('databaseRowName');
$this->db->from($tableSettings);
$query = $this->db->get();
return $query->result_array();
}
I am still having troubles to work with this array.
I printed the new arrays. This shows
Code:
print_r($structure);
Array ( [0] => Array ( [databaseRowName] => id ) [1] => Array ( [databaseRowName] => headword ) [2] => Array ( [databaseRowName] => numberHeadword ) [3] => Array ( [databaseRowName] => stem ) [4] => Array ( [databaseRowName] => order ))
This shows
Code:
print_r(array_keys($structure));
Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4)
How can I make from this array a new array with structure bellow?
Code:
$data = array(
'(value of first column of the first row)' => $_POST['(value of first column of the first row)'],
..
'(value of first column of the last row)' => $_POST['(value of first column of the last row)']
);
Thank you