Forums

CF5 not saving data to table

Mike Cross 09 Mar, 2014
Hi

New to ChronoForms. I have set up a form with radio buttons and checkboxes. Form is here
http://www.eghf.co.uk/index.php/37-lfa/lfa/208-lfa-online-membership-application feel free to test it.
Form can be filled in and submitted with no error messages, Setup as follows

The DB Save action looks like this

Data is not being saved to the database. It WAS saved to the deatabase earlier, there are two entries in teh database with submission date f 17 Feb but none of the tests since then have resulted in any data being saved. The e-mail action works fine, an e-mail is received for each submission.

I've tried disconnecting the database by deselecting the table in the Action Settings for DB Save, saving the form and then re-selecting the tble and saving again but it has made no difference.

Everything appears to be working correctly except that no data is saved to the table.

Any assistance gratefully received.

Mike
Mike Cross 09 Mar, 2014
Read tehm both and it hasn't helped.
Max_admin 09 Mar, 2014
Answer
Hi Mike,

Please try to disable the "Multi save" ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
GreyHead 09 Mar, 2014
Hi Mike,

The form looks OK - what do you see if you add a Debugger action?

Bob
Mike Cross 09 Mar, 2014
Max's suggestion fixed it. Can I suggest the action settings for DB save are amended so that the Multi Save option reads Save multiple records (ONLY use if the data array has a list of records data) instead of
Save multiple records if the data array has a list of records data

Many thanks

Mike
carvisiglia 13 Mar, 2014
Hi friends,

I am having the same problem as Mike. I followed your suggestion, but nothing happened. E-mails arrive properly with all fields, but no data are saved to the DB. Here is the debug: http://carvisiglia.altervista.org/chronoform_debug.png
what am I doing wrong?

Thanks for your answers,
Marcello
Max_admin 13 Mar, 2014
Hi Marcello,

Please show us a screenshot for your "Setup" area, and the "DB Save" config.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
carvisiglia 13 Mar, 2014
Hi Max,

thanks for answering. Here are the screenshots:

[attachment=0]Schermata 2014-03-13 alle 19.23.57.png[/attachment]

[attachment=1]Schermata 2014-03-13 alle 19.24.44.png[/attachment]

Ciao,
Marcello
Max_admin 13 Mar, 2014
All looks good, please try to add a custom code action after the "db save" and enter this code:

<?php
pr(\GCore\Models\MODEL_ID::getInstance()->dbo->log);


Replace "MODEL_ID" with your model id, now what do you get after the form is submitted ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
carvisiglia 13 Mar, 2014
Hi MAx,

i have done what you've suggested, but nothing changes. Emails arrive immediately and the database remain empty. Here is my last debug:
Max_admin 14 Mar, 2014
There is no data saved at all OR the record is saved but the fields are empty ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
carvisiglia 14 Mar, 2014
Hi Max,

there are no records saved at all! The database is accessible but it is empty. Here is the screenshot.

[attachment=0]Schermata 2014-03-14 alle 13.11.44.png[/attachment]

Ciao,
Marcello
Max_admin 15 Mar, 2014
Oh, I have just noticed this now, your form fields has a field named "id", which I guess is the same name of the primary key in your form, this triggers an update statement by the db save but not an "insert new", so, you will need to change this field name in your form.

I also think that the id is coming from the article's page, so the solution is to drag a "custom code" action before the "db save" and insert this code:
<?php
unset($form->data["id"]);


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
carvisiglia 15 Mar, 2014
Hi Max,

the last code you sent me WORKED PERFECTLY.

Thanks a lot!
BR,
Marcello

PS: how do I put the "Resolved" tag?
Max_admin 18 Mar, 2014
No problems!🙂

You can't put a resolved tag since this topic already had a selected answer, and only the topic original author can do it!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.