Hi,
I am using Chronoforms to create records in three tables eg:
mydatatable (id, published, text) I want published to = 1
mytagstable (id, published, tag) I want published to = 0
mydatatags (dataid, tagid)
I have mydatatable and mytagstable in DBConnection so the autogenerated code correctly creates a record in each of these tables
I changed the processing order to Plugins, Autogenerated, OnSubmit so that OnSubmit Code can retrieve the IDs of the two new records and write them to mydatatags:
The question is: How can I store different values in the two 'published' fields given that the RunOrder means I cant use the OnSubmit code?
I am using Chronoforms to create records in three tables eg:
mydatatable (id, published, text) I want published to = 1
mytagstable (id, published, tag) I want published to = 0
mydatatags (dataid, tagid)
I have mydatatable and mytagstable in DBConnection so the autogenerated code correctly creates a record in each of these tables
I changed the processing order to Plugins, Autogenerated, OnSubmit so that OnSubmit Code can retrieve the IDs of the two new records and write them to mydatatags:
$db =& JFactory::getDBO();
$itemid = $MyForm->tablerow["mydatatable"]->id;
$tagid = $MyForm->tablerow["mytagstable"]->id;
$query = "INSERT INTO `mydatatags` (tagid, itemid) VALUES ($tagid, $itemid)";
$db->setQuery($query);
$db->query();
The question is: How can I store different values in the two 'published' fields given that the RunOrder means I cant use the OnSubmit code?