Buy Now
Sign in

New Field not saving to DB

omidhz , November 29 2018, 22:32
O
omidhz 254
November 29 2018, 22:32 #381893
I have a form that saves or updates all the data to a database and it is working as it should.
I decided to add two more fields to the form called "wst" and "wst_unit", and I coded it just like other fields. Then I added two columns to the database via phpMyAdmin with the same names and format.
However, my form is NOT SAVING those two new fields to the database, even though the debugger shows it is saving it correctly. When I look at my debugger information, I don't see it listed where it suppose to save to the database.
I'm not sure what am I doing wrong.
See below:
Array
(
[chronoform] => demographics
[event] => submit
[activity] => 1.3
[ethnicity] => caucasian
[wt] => 222.00
[wt_unit] => 1
[ht] => 77.00
[ht_unit] => 1
[wst] => 36
[wst_unit] => 1
[button] =>
[cadc1bee9ebcbe83759a5448896141ea] => db907de6a339a1fb0a54fa254a7be221
[joomla_user_state] => logged_in
[format] => html
[Itemid] => 177
[option] => com_chronoforms6
[view] => form
)
Array
(
[validate_fields3] => Array
(
[log] => Automatic validation enabled.
[var] => 1
)

[save_data10] => Array
(
[data] => Array
(
[chronoform] => demographics
[event] => submit
[activity] => 1.3
[ethnicity] => caucasian
[wt] => 222.00
[wt_unit] => 1
[ht] => 77.00
[ht_unit] => 1
[wst] => 36
[wst_unit] => 1
[button] =>
[cadc1bee9ebcbe83759a5448896141ea] => db907de6a339a1fb0a54fa254a7be221
[joomla_user_state] => logged_in
[format] => html
[Itemid] => 177
[option] => com_chronoforms6
[view] => form
[modified] => 2018-11-29 22:24:35
)

[_success] => Data saved successfully
[log] => Array
(
[0] => UPDATE `response` AS `Data10` SET `activity` = '1.3', `ethnicity` = 'caucasian', `wt` = '222.00', `wt_unit` = '1', `ht` = '77.00', `ht_unit` = '1', `modified` = '2018-11-29 22:24:35' WHERE `user_ID` = '846';
)

[var] => Array
(
[activity] => 1.3
[ethnicity] => caucasian
[wt] => 222.00
[wt_unit] => 1
[ht] => 77.00
[ht_unit] => 1
[modified] => 2018-11-29 22:24:35
)

)

)
healyhatman 7
November 30 2018, 00:00 #381894
Clear the cohronoforms cache and try again
Web developer at SkySpider.com.au
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
O
omidhz 254
November 30 2018, 00:13 #381895
I already tried that twice. Still same result
O
omidhz 254
November 30 2018, 03:00 #381898
I was able to fix this, but I have no idea how it got fixed..!.
Here is what I did.
I created a new dummy form to retrieve and save just the wst field into the same data. The new form gave me MySql error #1064.!
Then I deleted the two columns that I previously made in phpMyAdmin from my database via phpMyAdmin.
Then I went to Chronoforms 6 and modified the database by adding the columns there. That fixed everything.
I've had this problem before that when I created a column via phpMyAdmin I was getting error messages, but when I added the columns via Chronoforms database tool, it worked fine. Is there something I'm doing wrong or is this related to how the form is linked to the database??!!
healyhatman 7
November 30 2018, 03:17 #381899
 Answer
I think the cache is not actually deleted when you tell it to delete the cache. Or something I don't know it shits me
Web developer at SkySpider.com.au
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
O
omidhz 254
November 30 2018, 03:20 #381900
You may be right. Every time I click on Clear Cache, I get the message that 0 cache was deleted.!
Where does the cache get saved? Maybe I can see if it actually deleting anything.. 
O
omidhz 254
November 30 2018, 03:42 #381901
 Answer
I found this file:
root: cache/myDatabaseName.db_tables_info.cache.php
It contains the cache related to my form database. I did delete the data manually and saved the file and my forms continued to work fine and after I processed the form, it recreated the cache.
When I clicked on Clear Cache in the Chronoform application, the cache information remained intact. I guess this could be the issue.
O
omidhz 254
November 30 2018, 04:01 #381902
 2
 Answer
I was able to reproduce the problem.
After I deleted the cache data manually, my form saved the new field to the database. This is clearly a bug in chornoform 6.
S
skittle 131
January 15 2019, 16:39 #382861
I experienced the same issue and agree that this a bug in CFv6. First, I tried refreshing the cache using the option in CF without success. Then, I tried deleting the cache file as suggested in this thread but this did not solve the problem for me either.
I was able to resolve this by switching the Save to database toggle (for the field not saving to the DB) to off, then saving the Chronoform. Next I opened the Chronoform again and switched the Save to database toggle back on and saved the Chronoform. This worked. While the cache may be a part of the problem here, it seems like the Save field to database option is not being save or updated as expected.
John
healyhatman 7
February 27 2019, 00:35 #384225
BUMP, this is still happening.
Web developer at SkySpider.com.au
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
J
jpbhcom 19
April 30 2019, 16:56 #386430
This is still an issue, I made a change to a table, and the delete cache function didn't clear the cache, I attempted to flush the cache via Joomla however this didn't find the db cache file, ultimately I had to manually delete the cache file.
admin 27
April 30 2019, 20:12 #386435
Do you have the latest update ? this should be already fixed!
Best regards
Max
If your main question got answered then please mark the answer using the button!
Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!