Forums

Insert instead of Update

veronique 17 Jul, 2014
Hi,

Submitting an edit form, CCFv5 do an INSERT action with NULL values instead of an UPDATE action.
My DBSave parameters is :
[attachment=0]dbsave.jpg[/attachment]

Then this is the debug message

Data Array

Array
(
    [option] => com_chronoconnectivity5
    [cont] => lists
    [ccname] => patronyme
    [act] => edit
    [gcb] => 3
    [chronoform] => patronyme
    [event] => submit
    [patronyme] => 3,BOUILDE,BOUILLEDÉ,BOULEDÉ,Ingrandes,,
    [button7] => Valider
    [Data] => Array
        (
            [id] => 10
        )

)

Array
(
)

Errors

Array
(
)

Debug Info

Array
(
    [11] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `jnew_chronoengine_chronoforms_datatable_patronyme` (`user_id`, `created`) values ('1634', '2014-07-17 21:32:24');
                        )

                )

        )

)
GreyHead 18 Jul, 2014
Hi Veronique,

Please remove the 'Data' in the Model ID. If you check the Debug output you'll see that is putting the value of id into a sub-array.

Bob
veronique 18 Jul, 2014
Thanks Grey, but it seems don't cahnge anything :

Data Array

Array
(
    [option] => com_chronoconnectivity5
    [cont] => lists
    [ccname] => patronyme
    [act] => edit
    [gcb] => 3
    [chronoform] => patronyme
    [event] => submit
    [patronyme] => 3,BOUILDE,BOUILLEDÉ BOULEDÉ,Ingrandes,,
    [button7] => Valider
    [id] => 12
)

Array
(
)

Errors

Array
(
)

Debug Info

Array
(
    [11] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `jnew_chronoengine_chronoforms_datatable_patronyme` (`user_id`, `created`) values ('1634', '2014-07-18 20:14:47');
                        )

                )

        )

)
GreyHead 19 Jul, 2014
HI Veronique,

Hmm . . . what is the name of the primary key column in the table?

Bob
veronique 24 Jul, 2014
Hi Grey,

Primary key column name is 'id'.

Véronique
This topic is locked and no more replies can be posted.