Form Submission onAfterProcess enter data in other table

Status
Not open for further replies.
Hello

I have got this code in the form plugin and it's being execute after the onAfterProcess.
However no data is entered in the database ?

// Get a db connection.
$db = JFactory::getDbo();

// Create a new query object.
$query = $db->getQuery(true);

// Insert columns.
$columns = array('status','agent_name');

// Insert values.
$values = array('1001','sylvain');

// Prepare the insert query.
$query
->insert($db->quoteName('#__track_handling'))
->columns($db->quoteName($columns))
->values(implode(',', $values));

// Set the query using our newly populated query object and execute it.
$db->setQuery($query);
$db->query();
 
In Firefox I get this message SyntaxError: JSON.parse: unexpected character

I have also try the plugin upsert for forms and I get the same error message.

It's a clean installation from Joomla 3.2.1 and only component installed is fabrik 3.1C2
 
SyntaxError: Unexpected token <
This usually comes from an error message in your network response.
Is your form in a popup?
You can check the network response with firebug
or display + submit the form normally (via a menu item) to see the error message.

Check column and table names (does your table really has the Joomla prefix?).
 
Form is in a popup screen
This is the info I get with firebug : Call to undefined method JModel::getInstance()
its called by the upsert.php plugin
Yes I have check and table and column name's are correct
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top