Forums

edit action doesnt update record

Max_admin 04 Jun, 2014
Answer
2 Likes
Hi homeopat,

Does your form have a hidden field with name matching the primary key field name in your table ?

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
admin_wiky 04 Jun, 2014
no, he didnt. I did use the form from CFv4 and import him to CFv5.
thx
admin_wiky 09 Jun, 2014
Hi Max or Bob,

if I have relation 1:N how to build a model?

I have set up:
Model: pronajimatelkontakty
relation: HasToMany
associated model: pronajimatel
associated save/delete: yes
FK: cf_id2
join conditions: <?php return array("pronajimatelkontakty.cf_id2=pronajimatel.cf_id");?>

data in form are shown, but when I change some value in form then arent updated to db after submit.

any idea? THX
Max_admin 11 Jun, 2014
You mean data is not updated in the 2nd table ? or the first one ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
admin_wiky 11 Jun, 2014
in the second table

the scheme of relations is (I use models id):
1st (main) -> 2nd (has realation BelongsTo)
1st (main) -> 3rd (has realation BelongsTo)
3rd -> 4th (has realation HasToMany)

Hope, u understand this
Max_admin 13 Jun, 2014
Does your form include the primary key of the 2nd table records ? they must be available as well!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
admin_wiky 13 Jun, 2014
I realized that I maybe have bad relation type.
1st (main) -> 2nd is in 1:1
1st (main) -> 3rd is in 1:1
3rd -> 4th is in 1:N

I am not sure what are differences between BelongsTo and HasOne?

First I used belongsTo, but maybe have to be HasOne.

Sorry I didnt mention it. I am talking about 4th table (1:N)
Do u mean that form must include primary key as a hidden field of every table? I have hidden field as PK of first table only, but data are updated in every table except of 4th table.
every table I has cf_id as PK, 4th table has cf_id2 as FK.
I am not sure if u understand me

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