I think for better answers to eform2db you have to post your questions in the eform2db topic!
you can try this with eform2db:
<?php
function eForm2db( &$fields )
{
/*---------------------------------------------------------------
eForm2db
Version: 0.1 [Beta 1]
Author: pixelchutes
---------------------------------------------------------------
Requirements:
eForm 1.4+
---------------------------------------------------------------
Use:
- Takes validated eForm submittal data for use with the MODx DBAPI extender class.
- Easily process database records referencing your form submission data:
+ INSERT new records to a table of your choice
+ UPDATE existing records if you'd prefer
+ DELETE records based on form submittal criteria
+ Form a query and return its record set as XML using $modx->db->getXML
+ Query a table's MetaData using $modx->db->getTableMetaData, followed by an update query
on only the form fields that are named after table columns!
+ and much more!
---------------------------------------------------------------*/
// Bring needed resources into scope
global $modx, $table_prefix;
// Init our array
$dbTable = array(); // key = DB Column; Value = Insert/Update value
// Insert field/value pairs to insert/update in our table
//$dbTable[name] = $fields[first_name].' '.$fields[last_name]; // Merge two form fields together
//$dbTable[datetime] = date( 'YmdHis', strtotime( $fields[postdate] ) ); // Massage the postdate timestamp to be MySQL insert friendly
$storefields='region,suburb,centre,street,contact,phone,email,website';
$fieldnames=explode(',',$storefields);
foreach ($fieldnames as $fieldname){
$dbTable[$fieldname] = $fields[$fieldname];
}
// INSERT - $dbQuery = $modx->db->insert( $dbTable, $table_prefix . 'insertTableName' );
// UPDATE - $dbQuery = $modx->db->update( $dbTable, $table_prefix . 'updateTableName' );
// DELETE - $dbQuery = $modx->db->delete( $table_prefix . 'deleteFromTableName', 'some_field = 1 AND name=\''.$dbTable[name].'\'', '' );
// etc...
// Run the db insert query
$dbQuery = $modx->db->insert( $dbTable, $table_prefix . 'members' );
return true;
}
// Return empty string
return '';
?>
what do you see when you add the second line to eForm2db ?
global $modx, $table_prefix;
print_r($fields);
perhaps with cached call?
[[eForm2db]]