Buy Now
Sign in

Save to database action misses one field

tshirley , May 26 2021, 04:53
T
tshirley 327
May 26 2021, 04:53 #396554
I have a successful form saving to a table in Insert and Update modes, but I wanted to include an additional field in the save.
So I added the field in the table, and to the data model I use for the save, but although all the other fields are saving correctly,
Although all the data and field names match, I can't get the Save action to recognise the new field in the generated SQL. For example...
   [save_data77] => Array
(
[data] => Array
(
[firstname] => xxxx
[lastname] => xxxxx
[informal_name] =>
[other_names] =>
[mailingstreet] => xxxxx
[mailingcity] => xxxxx
[mailingstate] => xxxx
[mailingpostalcode] => xx
[mailingcountry] => xxxxx
[nationality] =>
[occupation] =>
[birthdate] => xxxxx
[homephone] => xxxx
[mobilephone] => xxxx
[email] => zz@gmail.com
[gmclubcode] => jjj
[gender] => Male
[date_joined] => bbbbb
[paid_until_date] => pppp
[gm_mbr_type] =>
[mid] => 12560
[status] => xxx
[club_name] => cccccc
[created] => 2021-05-26 04:28:08
[user_id] => 0
)

[_success] => Data saved successfully
[log] => Array
(
[0] => INSERT INTO `2bi_cf6_members` (`firstname`, `lastname`, `informal_name`, `other_names`,
`mailingstreet`, `mailingcity`, `mailingstate`, `mailingpostalcode`, `mailingcountry`, `nationality`, `occupation`, 
`birthdate`, `homephone`, `mobilephone`, `email`, `gmclubcode`, `gender`, `date_joined`, `paid_until_date`, `gm_mbr_type`, 
`mid`, `status`, `created`, `user_id`)  values  ('xxxx', 'xxxxx', '', '', 'xxxx', 'xxxxx', 'xxxxx', 'xxx', 'xxx', '', '', 
'xxxx', 'xxxx', 'xxxx', 'xxxxx', 'xxx', 'xxx', 'xxxxx', 'xxxxx', '', 'xxx', 'dddd', 'aaaaaaa', '0');
)

[var] => Array
(
[firstname] => xxx
[lastname] => xxx
[informal_name] =>
[other_names] =>
[mailingstreet] => xxx
[mailingcity] => xxx
[mailingstate] => xxxx
[mailingpostalcode] => xxx
[mailingcountry] => xxx
[nationality] =>
[occupation] =>
[birthdate] => xxx
[homephone] => xxx
[mobilephone] => xxx
[email] => aagmail.com
[gmclubcode] => aaa
[gender] => Male
[date_joined] => aaa
[paid_until_date] => aaa
[gm_mbr_type] =>
[mid] => 12560
[status] => aaa
[created] => aaa
[user_id] => 0
[aid] => 5
)

)

)
In this example the field club_name appears in the data array but not in the sql or in the var section.
I have been trying to solve this for a while, does anyone have an idea what I may be doing wrong?
Thanks
Tim
GreyHead 65
May 26 2021, 10:27 #396555
Hi Tim,
Please try clearing the ChronoForms Cache as the table info is saved there temporarily and may not have been updated.
Bob
If you'd like to buy me a coffee or two, thank you very much
T
tshirley 327
May 26 2021, 13:42 #396559
Yep, that worked..
Thanks again
Tim