We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19989
    • 3 Posts
    [!noob!] sad

    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;
    }
    ?>