[!noob!]
Hi, I am unable to submit my form to a different DB using the modxAPI+eform2db.
Has anyone done this?
$mydb= new DBAPI();
$mydb->connect($host=’---’,$dbase=’---’, $uid=’---’,$pwd=’---’);
function SendvcMessage( &$fields )
{
global $modx;
// Init our array
$dbTable = array();
$dbTable[subject] = $fields[subject];
$dbTable[date] = $fields[ddmmyyyy];
$dbTable[message] = $fields[message];
// Run the db insert query
$dbQuery = $mydb->db->insert($dbTable, ’vcmessage’ );
// I have tried this as well... $dbQuery = $mydb->insert($dbTable, ’vcmessage’ );
return true;
}
?>