On 3 mayo, 10:50, ifcanduela <[EMAIL PROTECTED]> wrote:
> Come on guys, somebody must've stumbled upon this before...
>
> I guess I could add some more info: this only happens when I try to
> add a new child (a country) to the parent (the region) to which the
> country with id=1 already belongs to. If I manually delete that id=1
> country, all works right, and if I add countries to any other region,
> they are inserted ok. But if, as I said before, I try to insert a new
> child with the same region_id of the country with id=1, this last
> country's record gets updated insead of a new one inserted.
>
> Any help would be great, thanks in advance.
You haven't provided a lot of details or any code, but if for example
your url is /Countries/add_region/2, cake is going to assign your main
model (Countries) the first parameter as it's primary key (and thus
any save will update row 2 not add ) - just call $this->Country-
>create(); before you proceed if that's the case.
If that isn't the case - don't be afraid to show your code ;).
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---