Forums

Chronoform doesn't save in database after modification

laurentmartin 10 Oct, 2011
Hi,
I am facing a problem:
I have created a form + a table to save in it.

I found out two cases:

1./ Case one: if i create the database manually in phpmyadmin, then chronoform will not save the data

2./ Case two: if you generate a table using chronoform once you have created your form , then later if you modify this form to add some field, even if you update the table manually or via chronoform with the new fields, then chronoform will not save those new field.

I have tried to connecte / unconnecte / reconnect the form and the table and still nothing.

Does the only way to make this working is to delete the previous table and create a new one ?

Regards
GreyHead 10 Oct, 2011
Hi laurentmartin ,

Neither of these are true.

1) ChronoForms will work with any table provided that it has a numeric primary key and the column and table names do not contain spaces or other special characters apart from a-zA-Z0-9 and underscore.

2) If you add new columns and or inputs then, provided that the names are valid (see above) and you do a DB Refresh (see below) in CFv3 (it's not needed in CFv4) then ChronoForms will work with the new columns/inputs.

If is isn’t working for you then check the names carefully, that's usually where the problem lies.

Bob

You need to refresh the DB Connection after any changes to database column names. In the Form Editor click the DB Connection tab and set the Connection to 'No'. Click the 'Apply icon in the toolbar to save the form, open the DB Connection tab, set the Connection back to 'Yes' and re-save the form. This will refresh the copy of the table information that ChronoForms uses.
parcs 07 Nov, 2011
Hi, i've got the same problem. When I modify a form adding new fields, these new fields appear in the table (I can see them in the "create table" tab), but Chronoform don't save the new data in the db.
I checked the names of the fields and they are correct.
I'm using CFv4, though I tried to refresh the database too (in the Form wizard I clicked on "events", then "on Submit"/"DB Save", switched "Enabled" to no, saved, re-opened the form wizard and switched "Enabled" to yes again). It didn't solve the problem.

Any idea?
Thanks!
GreyHead 07 Nov, 2011
Hi parcs,

As far as I know it should be enough to resave the form.

If you temporarily turn site Debug on what do you see in the MySQL query that in updating your table?

Bob
t.vander.molen 13 Nov, 2011
Hi Grayhead,

I have the same problem. See the debug info. The formfieds are not stored!

SELECT *
FROM `j17_chronoforms`
WHERE `name` = 'aanvraagformulier'
AND `published` = '1'
SELECT *
FROM `j17_chronoform_actions`
WHERE `chronoform_id` = '1'
ORDER BY `
order`
SHOW FULL COLUMNS
FROM `j17_chronoforms_data_aanvraagformulier`
SHOW FULL COLUMNS
FROM `j17_chronoforms_data_aanvraagformulier`
INSERT INTO `j17_chronoforms_data_aanvraagformulier` (`cf_uid`,`cf_created`,`cf_ipaddress`,`cf_user_id`)
VALUES ('b5735eab11b61872d47fc6da33fb75b7','2011-11-13 19:44:30','82.157.116.51','0')
SELECT *

Overige tabellen:

2 × SHOW FULL COLUMNS FROM `j17_chronoforms_data_aanvraagformulier
1 × INSERT INTO `j17_chronoforms_data_aanvraagformulier` (`cf_uid`,`cf_created`,`cf_ipaddress`,`cf_user_id`) VALUES ('b5735eab11b61872d47fc6da33fb75b7','2011-11-13 19:44:30','82.157.116.51','0'
GreyHead 14 Nov, 2011
Hi t.vander.molen,

It looks as though those may be the only columns in the table?? By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
laurentmartin 15 Nov, 2011
I am facing another problem on my side.
I use the following configuration:
Virtuemart + Chronoform + Bixie Vm Chrono module.

All can work well unless I try to save the data in two differents database in the same time.
If I save in only one database, then it works...
GreyHead 16 Nov, 2011
Hi laurentmartin,

I think this is probably the bug noted in item d in the bugs list here

Bob
laurentmartin 18 Nov, 2011
Hi Bob,
Actually I am using V3.2 not V4.
Any other suggestion ?
I am wondering if this problem doesn't come from an incompatibility with the VM Chrono Bixie module?
Regard
GreyHead 24 Nov, 2011
Hi LaurentMartin,

It's possible that there is intereference from the Bixie module but it seems unlikely to me.

If you turn on Site Debug you should be able to see the MySQL queries and get a better idea of what is happening.

Bob
GreyHead 25 Nov, 2011
Hi t.vander.molen ,

Sorry for the delay, I was away and then lost the place in this thread.

Fixed, you had the 'Save under Model ID option set to yes - in this case ChronoForms only saves data in the $form->data['model_id'] array . . . and none of your data was.

Bob

PS I see a problem with the Datepicker input validation messages. I think that there is a fix for this. Please upgrade to RC2.0 if you haven't already done so.
t.vander.molen 25 Nov, 2011
Thom> Thanks for your time to solve the problem!
Mushr00m 16 Jan, 2012
I've the same issue, i tried to update a form that already save record in the DB. Bu the new field is not create in the DB and of course, not saved too...

I'm using the V4, have you any idea ?

Thanks
GreyHead 16 Jan, 2012
Hi Mushr00m ,

I think you'll need to use PHPMyAdmin to add the column to the table. Then re-save the form to update the form table records and it should save OK.

Bob
Mushr00m 19 Jan, 2012
Hi GreyHead thanks for your help.

Do you know how to connect Chronoform to the new column table ? Do I need to give a special name to this new collumn to help chronoform to find it by himself ?

Thanks again
GreyHead 19 Jan, 2012
Hi Mushr00m ,

The column name needs to match the input name exactly.

In ChronoForms v4 you need to save the form to update the connection.

In ChronoForms v3 you need to refresh the DB Connection after any changes to database column names. In the Form Editor click the DB Connection tab and set the Connection to 'No'. Click the 'Apply icon in the toolbar to save the form, open the DB Connection tab, set the Connection back to 'Yes' and re-save the form.

Bob
Mushr00m 21 Jan, 2012
Thanks it works perfectly !
monray 27 May, 2012
hi
I have this same problem

1./ Case one: if i create the database manually in phpmyadmin, then chronoform will not save the data

2./ Case two: if you generate a table using chronoform once you have created your form , then later if you modify this form to add some field, even if you update the table manually or via chronoform with the new fields, then chronoform will not save those new field.

I have tried to connecte / unconnecte / reconnect the form and the table and still nothing.

Does the only way to make this working is to delete the previous table and create a new one ?




I installed the latest version of v4 Chronoform
in jomla 2.5

I can help

thanks for the great work

sorry for my bad English

regards
GreyHead 27 May, 2012
Hi monray,

The answer has only changed a little

Neither of these are true.

1) ChronoForms will work with any table provided that it has a numeric primary key and the column and table names do not contain spaces or other special characters apart from a-zA-Z0-9 and underscore.

2) If you add new columns and or inputs then, provided that the names are valid (see above) and you do a DB Refresh (see below) in CFv3 (it's not needed in CFv4, you just need to re-save the form) then ChronoForms will work with the new columns/inputs.

If is isn’t working for you then check the names carefully, that's usually where the problem lies.


Bob
monray 28 May, 2012
hi Bob
my English very bad
I will post images

1, create a new item
and give it to save


2 º I phpmyadmin and not to
created the table



I'm doing wrong?

regards
GreyHead 29 May, 2012
Hi monray,

You need to add the new column to the database table using PHPMyAdmin.

Bob
monray 29 May, 2012
hello
I have to
add it
manually in phpmyadmin

wonder
in joomla administration
if you create the table
but not exported to phpmyadmin




regards
GreyHead 29 May, 2012
Hi monray,

If you delete the existing table you can create a new one from ChronoForms with all of the columns. But you have to use PHPMyAdmin for the deletion.

You could create a new table with a different name if you like.

Bob
monray 29 May, 2012
that's the problem
I believe in the ChronoForms but
not created in phpMyAdmin


and once created
when I return to
enter this field in
target

regards
GreyHead 29 May, 2012
Hi monray,

I'm sorry, whatever you wanted to say got lost in translation. Write in Spanish if you prefer and get Google to translate.

Lo siento, lo que quería decir se perdió en la traducción. Escribir en español si lo prefieres y obtener de Google para traducir.

Bob
monray 30 May, 2012
good morning bob

from the beginning
this is the problem

I think a form
I keep it new
and created a database

Now I add a
new field


if the table is created in ChronoForms



this new field is not
created in phpMyAdmin



regards
GreyHead 31 May, 2012
Hi monray,

The simple answer is just to add the extra column in PHPMyAdmin.

To add it using the ChronoForms table creator you must delete the old table first.

Bob
monray 01 Jun, 2012
ok, I'll try

thanks
spinarenato@tin.it 19 Jun, 2012
Hi Bob
sorry to trouble you but I'm not able to solve this problem.
CF V3: I've added a new field in the form adding this code in the HTML form:

<div class="form_item">
  <div class="form_element cf_textarea">
    <label class="cf_label" style="width: 150px;">descrizione</label>
    <textarea class="cf_inputbox" rows="3" id="" title="" cols="30" name="descrizione"></textarea>
    
  </div>
  <div class="cfclear"> </div>
</div>

Db NEW column name is "descrizione".
To refresh the DB, in the Form Editor I've clicked the DB Connection tab and set the Connection to 'No'. Than I've clicked the 'Apply icon in the toolbar to save the form, opened the DB Connection tab, setted the Connection back to 'Yes' and re-saved the form.

I've tried hundered times but still NEW data are not saved in the DB.

Do you have some more suggestion to save me to became crazy?
Thanks a lot in advance
GreyHead 26 Jun, 2012
Hi [email]spinarenato@tin.it[/email],

There isn't anything else required.

Try setting Site Debug on temporarily and checking the debug output to see exactly what query is being created.

It may also be worth checking that the input name and the column name are *exactly* the same.

Bob
wnedoe 13 Jan, 2013
Hi!

I am a little confused about the behaviour of CF4 with added fields and need some clarification:

First you write:

2) If you add new columns and or inputs then, provided that the names are valid (see above) and you do a DB Refresh (see below) in CFv3 (it's not needed in CFv4) then ChronoForms will work with the new columns/inputs.



a few posts later

You have to add the colummn with phpmyadmin



?? so what ??

Please clearly specify:
Is a field/colummn that has been added to the form with the wizard
(after the table has been initially created by CF4)
automatically added to the database by CF4 or NOT?

Do I have to add a field/colummn with phpmyadmin or NOT?

I do understand that i can just create a NEW database but all data would be lost in that case (they would stay in the old db and would have to be migrated to the new table to be specific)

So the easier solution would be to manually change the db to add the additional field or NOT?

But the SQL query itsself for the insert is automatically updated if the form is saved? Correct?


Best regsrds
Alex
GreyHead 14 Jan, 2013
Hi wnedoe,

If you want to add a new column to a database table then you need to do that with PHPMyAdmin (or some other database tool).

Adding a new input to your form will not make any change to the database (ChronoForms has no idea if you want to add the column or not.)

You do not want to create a new 'database', you may want to create a new table in your existing database. It only makes sense to do this if you are still developing your form and there is no useful data in the old table. If you have date that you want to keep then add anew column to that table.

The SQL query for the DB Save is automatically updated. If there is a column in your table with the same name as a value in the form results that it will be saved.

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