3
Unfortunately it does not work
Have a look at this code
if ($table_nbfields > 0) {
$datas = array();
for( $i = 0; $i < $table_nbfields; $i++ ) {
$datas = array('field_mid' => $table_mid[$i],
'field_tid' => $table_id[$i],
'field_numb' => $table_nbfields[$i],
'field_name' => $_POST['field_name'][$i],
'field_type' => $_POST['field_type'][$i],
'field_value' => $_POST['field_value'][$i],
'field_attribute' => $_POST['field_attribute'][$i],
'field_null' => $_POST['field_null'][$i],
'field_default' => $_POST['field_default'][$i],
'field_key' => $_POST['field_key'][$i],
'field_autoincrement' => (($_REQUEST['field_autoincrement'][$i] == 1) ? '1' : '0'),
'field_element' => $_POST['field_element'][$i],
'field_inlist' => (($_REQUEST['field_inlist'][$i] == 1) ? '1' : '0'),
'field_inform' => (($_REQUEST['field_inform'][$i] == 1) ? '1' : '0'),
'field_admin' => (($_REQUEST['field_admin'][$i] == 1) ? '1' : '0'),
'field_user' => (($_REQUEST['field_user'][$i] == 1) ? '1' : '0'),
'field_block' => (($_REQUEST['field_block'][$i] == 1) ? '1' : '0'),
'field_main' => (($i == $_REQUEST['field_main']) ? '1' : '0'),
'field_search' => (($_REQUEST['field_search'][$i] == 1) ? '1' : '0'),
'field_required' => (($_REQUEST['field_required'][$i] == 1) ? '1' : '0')
);
}
foreach ($datas as $data => $value) {
$obj->setVars(array($data, $value));
$fieldsHandler->insert($obj);
}
}