Forums

Not saving to database

ronny.van.der.borght 24 Oct, 2014
Hi,

I have created a form, attached a database, the user-email and admin-email are send but the values are not saved in the database.
Debugger:


If I turn on Joomla error reporting i get this:

Parse error: syntax error, unexpected '-', expecting '{' in /data/sites/web/xxxxxxxxx/www/administrator/components/com_chronoforms5/chronoforms/actions/db_save/db_save.php(72) : eval()'d code on line 4

I only have 3 fields: naam,email,aantalpersonen. I'm not sure how the DB Viewer should be used, but since there is no data inserted into the database there is nothing to view at this point.

Please advice .
GreyHead 24 Oct, 2014
Hi ronny.van.der.borght,

Do you have the latest release of CFv5 installed - I can't match up the error message you posted with the code in the version I have installed.

Do you have a - in any of your database column names?

Bob
ronny.van.der.borght 25 Oct, 2014
I'm running ChronoForms5 version 5.02
Table names are just one word:

[attachment=0]table.jpg[/attachment]
GreyHead 25 Oct, 2014
Hi ronny.van.der.borght,

Apologies my local copy of the file was out of date :-( I can now see where the error is coming from. - it appears to be this line
var $tablename = "'.$config->get('tablename', '').'";


Please check the DB Save action settings, is the table name set there correctly?

Bob
ronny.van.der.borght 25 Oct, 2014
Hello Bob,

Yes it is, there is no way that you could set this wrong because it is a dropdown with a list of the available tables.
[attachment=0]dbsave.jpg[/attachment]

Strange huh ?
GreyHead 25 Oct, 2014
Hi ronny.van.der.borght,

Hmm . . . I don't know By all means email or PM me the site URL, the form name, and a SuperAdmin login and I'll take a quick look.

Bob
GreyHead 27 Oct, 2014
Hi ronny.van.der.borght,

I made a copy of the form; disabled the emails for testing and the copy form is now saving correctly to the database. I think that the problem is with the way the emails are set up :-(

Please check that any 'dynamic' boxes use only input names (you have full email addresses in some). Also I strongly recommend that you do *not* use the Dynamic From Email element in your Email Setups. Using this often results in your emails being marked as spam and dropped into a spam filter. Instead use the static From Email with an address that matches the site domain name and use Dynamic ReplyTo Email for the user email. The result is the same but with a much better chance of good delivery.

Bob
ronny.van.der.borght 27 Oct, 2014
Thanks fo looking into this Bob. I'll see if I can make this work without the dynamic stuff.
Enjoy a nice cold one ! I can recommend 'Tongerlo Blond' that was elected 'world's best beer' last month. It is brewded only 15km from my hometown.
GreyHead 27 Oct, 2014
Hi Ronny,

Thank you.

The Dynamic stuff will work where it is needed. Just make sure that you put 'real' email addresses into the To Email box and input names into the Dynamic To.

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