Parse error on 'DB Save'

PicoPaco 26 Oct, 2011
Hi,

I have a form that I wish to save to db. The '$form->data' array looks good and I have the db-fields named after the array data. I have a 'DB Save' on submit, but when I try the form out I get this message:

Parse error: syntax error, unexpected '$', expecting T_VARIABLE in /storage/content/....../administrator/components/com_chronoforms/form_actions/db_save/db_save.php(63) : eval()'d code on line 33

Fatal error: Call to a member function bind() on a non-object in /storage/content/....../administrator/components/com_chronoforms/form_actions/db_save/db_save.php on line 86
GreyHead 27 Oct, 2011
Hi PicoPaco,

Hard to tell from the info here but most likely a special character in an input or column name??

Bob
PicoPaco 28 Oct, 2011
I'll created a new db-table, and it seems to be working. My problem now is to have the '$form->data' array to write to the database. The DB-Save will create a nested array (default chronoform_data) from wich it will write. How can I put all values from data to chronoform_data, or get the DB to write from data?
GreyHead 28 Oct, 2011
Hi PicoPaco,

The DB Save will save the data from the $form->data array where the input names match the column names (unless you specify a special Model ID).

Bob
PicoPaco 30 Oct, 2011
Hi Bob,

When I try to do the db-save doesn't match and save from the '$form->data' array. It only saves from the input fields from the redirect page. I can see in the debugger that the array looks like I want it to, but no saves to db from the array.
PicoPaco 30 Oct, 2011
Okey, I got it to work. I had to set a 'session to data' on submit before 'DB-save'. Does this make any sense?
GreyHead 31 Oct, 2011
Hi PicoPaco,

Yes, I think that makes sense.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger