Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
1 + 7 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     
addElement(new TDMCreateFormLabel('')); $form->addElement(new TDMCreateFormLabel('')); $form->addElement(new TDMCreateFormLabel(''.$title.'')); $form->addElement(new TDMCreateFormLabel('')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_NUMBER.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_NAME.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_TYPE.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_VALUE.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_ATTRIBUTE.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_NULL.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_DEFAULT.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_KEY.'')); $form->addElement(new TDMCreateFormLabel(''._AM_TDMCREATE_FIELD_PARAMETERS.'')); $form->addElement(new TDMCreateFormLabel('')); $form->addElement(new TDMCreateFormLabel('')); //$fields = $fieldsHandler->getObjects(null); $class = ''; for($i = 1; $i addElement(new TDMCreateFormLabel('')); // Index ID $form->addElement(new TDMCreateFormLabel(''.$i.'')); // Field Name $this_field_name = $isNew ? (!empty($f_name) ? $f_name . '_' : '') : $this->getVar('field_name'); $field_name = new XoopsFormText(_AM_TDMCREATE_FIELD_NAME, 'field_name['.$i.']', 15, 255, $this_field_name); $form->addElement(new TDMCreateFormLabel(''.$field_name->render().'')); // Field Type $fieldtype_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_type['.$i.']', $this->getVar('field_type')); $fieldtype_select->addOptionArray($fieldtypeHandler->getList()); $form->addElement(new TDMCreateFormLabel(''.$fieldtype_select->render().'')); // Field Value $field_value = new XoopsFormText(_AM_TDMCREATE_FIELD_VALUE, 'field_value['.$i.']', 5, 20, $this->getVar('field_value')); $form->addElement(new TDMCreateFormLabel(''.$field_value->render().'')); // Field Attributes $field_attributes_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_TYPE, 'field_attribute['.$i.']', $this->getVar('field_attribute')); $field_attributes_select->addOptionArray($fieldattrsHandler->getList()); $form->addElement(new TDMCreateFormLabel(''.$field_attributes_select->render().'')); // Field Null $field_null_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_NULL, 'field_null['.$i.']', $this->getVar('field_null')); $field_null_select->addOptionArray($fieldnullHandler->getList()); $form->addElement(new TDMCreateFormLabel(''.$field_null_select->render().'')); // Field Default $field_default = new XoopsFormText(_AM_TDMCREATE_FIELD_DEFAULT, 'field_default['.$i.']', 15, 25, $this->getVar('field_default')); $form->addElement(new TDMCreateFormLabel(''.$field_default->render().'')); // Field Key $field_key_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_KEY, 'field_key['.$i.']', $this->getVar('field_key')); $field_key_select->addOptionArray($fieldkeyHandler->getList()); $form->addElement(new TDMCreateFormLabel(''.$field_key_select->render().'')); // Field Autoincrement if($i == 1) { $field_autoincrement = $this->isNew() ? 0 : $this->getVar('field_autoincrement'); $check_field_autoincrement = new XoopsFormCheckBox(' ', 'field_autoincrement['.$i.']', $field_autoincrement); $check_field_autoincrement->addOption(1, _AM_TDMCREATE_FIELD_AUTO_INCREMENT); $form->addElement(new TDMCreateFormLabel(''.$check_field_autoincrement->render().'')); } elseif($i > 1) { // Box header row $parameters_tray = new XoopsFormElementTray('', ''); // Field Elements $field_elements_select = new XoopsFormSelect(_AM_TDMCREATE_FIELD_ELEMENT_NAME, 'field_element['.$i.']', $this->getVar('field_element')); $field_elements_select->addOptionArray($fieldelementsHandler->getList()); $criteria = new CriteriaCompo(new Criteria('table_id', $f_tid)); $criteria->add(new Criteria('table_mid', $f_mid)); $criteria->setSort('table_name'); $criteria->setOrder('ASC'); $table_arr = $tablesHandler->getAll($criteria); unset($criteria); foreach (array_keys($table_arr) as $xft_other) { $form_table_name = $table_arr[$xft_other]->getVar('table_name'); if ( $xft_other[$i] == 'XoopsFormTables-'.$form_table_name ) { $field_elements_select->addOption('XoopsFormTables-'.$form_table_name, 'Table : '.$form_table_name); } } $parameters_tray->addElement($field_elements_select); $field_inlist = $this->isNew() ? 0 : $this->getVar('field_inlist'); $check_field_inlist = new XoopsFormCheckBox(' ', 'field_inlist['.$i.']', $field_inlist); $check_field_inlist->addOption(1, _AM_TDMCREATE_FIELD_INLIST); $parameters_tray->addElement($check_field_inlist); $field_inform = $this->isNew() ? 0 : $this->getVar('field_inform'); $check_field_inform = new XoopsFormCheckBox(' ', 'field_inform['.$i.']', $field_inform); $check_field_inform->addOption(1, _AM_TDMCREATE_FIELD_INFORM); $parameters_tray->addElement($check_field_inform); $field_admin = $this->isNew() ? 0 : $this->getVar('field_admin'); $check_field_admin = new XoopsFormCheckBox(' ', 'field_admin['.$i.']', $field_admin); $check_field_admin->addOption(1, _AM_TDMCREATE_FIELD_ADMIN); $parameters_tray->addElement($check_field_admin); $field_user = $this->isNew() ? 0 : $this->getVar('field_user'); $check_field_user = new XoopsFormCheckBox(' ', 'field_user['.$i.']', $field_user); $check_field_user->addOption(1, _AM_TDMCREATE_FIELD_USER); $parameters_tray->addElement($check_field_user); $field_block = $this->isNew() ? 0 : $this->getVar('field_block'); $check_field_block = new XoopsFormCheckBox('', 'field_block['.$i.']', $field_block); $check_field_block->addOption(1, _AM_TDMCREATE_FIELD_BLOCK); $parameters_tray->addElement($check_field_block); $field_mnfield = $this->isNew() ? 1 : $this->getVar('field_main'); $field_main = new XoopsFormRadio('', 'field_main['.$i.']', $field_mnfield); $field_main->addOption( $i, _AM_TDMCREATE_FIELD_MAINFIELD ); $parameters_tray->addElement($field_main); $field_search = $this->isNew() ? 0 : $this->getVar('field_search'); $check_field_search = new XoopsFormCheckBox(' ', 'field_search['.$i.']', $field_search); $check_field_search->addOption(1, _AM_TDMCREATE_FIELD_SEARCH); $parameters_tray->addElement($check_field_search); $field_required = $this->isNew() ? 0 : $this->getVar('field_required'); $check_field_required = new XoopsFormCheckBox(' ', 'field_required['.$i.']', $field_required); $check_field_required->addOption(1, _AM_TDMCREATE_FIELD_REQUIRED); $parameters_tray->addElement($check_field_required); $form->addElement(new TDMCreateFormLabel(''.$parameters_tray->render().'')); } $form->addElement(new XoopsFormHidden('field_id['.$i.']', $i)); } $form->addElement(new XoopsFormHidden('field_mid', $field_mid)); $form->addElement(new XoopsFormHidden('field_tid', $field_tid)); $form->addElement(new XoopsFormHidden('field_numb', $field_numb)); $form->addElement(new TDMCreateFormLabel('')); $form->addElement(new TDMCreateFormLabel('')); $form_hidden = new XoopsFormHidden('op', 'save'); $form_button = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); $form->addElement(new TDMCreateFormLabel(''.$form_hidden->render().'')); $form->addElement(new TDMCreateFormLabel(''.$form_button->render().'')); $form->addElement(new TDMCreateFormLabel('')); return $form; } [/code] I posted all the code so that can see even those who are not registered to the forum and the potential to help[/quote]" />

Re: Inserting multiple rows in database table
by timgno on 2014/5/2 11:48:05

For this reason, I have now created a tutorial that explains how you can do it in a very simple way, a script, which through a simple form, send the data to the mysql database mode multirows with php
Re: Inserting multiple rows in database table
by timgno on 2014/5/1 22:45:20

Even if none of you has been technically help, I'm glad I shared the idea with you

It helped me to understand that I had to go back to the basis of the studies php.

In fact, rebuilding all the work behind it, with mysql, php and a simple form, I created a mini, mini, mini, cms, "please let me get through these words" , I was able to rebuild all the code necessary and is enough to cancel rather than add another code.

Great, is it?

Thanks anyway for having contributed to the idea at least.
Re: Inserting multiple rows in database table
by redheadedrod on 2014/5/1 22:21:31

Cool. Great that it worked for you. I wasn't sure if you could pass an array like that to setVars or not.

Hope my input helped you progress.

Only wish I could have been more help.

Rodney
Re: Inserting multiple rows in database table
by timgno on 2014/5/1 17:50:02

It was very simple

It was enough to remove the foreach loop, and instead use an array datas with setVars(), used directly the setVar() function for each variable, and checks on the same variables with isset

View the file in svn
Re: Inserting multiple rows in database table
by timgno on 2014/4/24 18:16:18

It's true what you say about security.

In any case, the module in question works only locally, at least from what I see and I do.

This module would have no meaning for the time to install it on a remote server.

In a local server you can make any changes you want.

I Sending files, that mentioned earlier, in svn

if you want to take a look at the code.

Who's Online

144 user(s) are online (117 user(s) are browsing Support Forums)


Members: 0


Guests: 144


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits