Hey RoadRunner
I'm not sure I would use named parameters to update records like that, I
understand your concern and I think I would share the same concerns.
It sounds like you want to be able to edit multiple records in place
without having to view each individual record in a edit page, and go
th
Hi,
i'm new to CakePHP and try to build my first database application. So far i
can list all customers in my test-database and view/edit a customer via a
link with the customer id passed as a named parameter.
At the moment i have 2 links to different controllers in each row of the
customer lis
Thanks ecsyle. its work!!
On Sat, Sep 17, 2011 at 4:37 AM, ecsyle wrote:
> You need the id of A in your data set:
>
> echo $this->Form->input('A.id');
>
> On Sep 16, 10:48 am, Mohd Hasnol wrote:
> > Hi,
> >
> > If i use saveAll, it will add another A data. What happen? Thanks.
> >
> >
> >
> >
>
You need the id of A in your data set:
echo $this->Form->input('A.id');
On Sep 16, 10:48 am, Mohd Hasnol wrote:
> Hi,
>
> If i use saveAll, it will add another A data. What happen? Thanks.
>
>
>
>
>
>
>
> On Thu, Sep 15, 2011 at 4:54 PM, WebbedIT wrote:
> > As #2will advised, your problem is:
>
Hi,
If i use saveAll, it will add another A data. What happen? Thanks.
On Thu, Sep 15, 2011 at 4:54 PM, WebbedIT wrote:
> As #2will advised, your problem is:
> $this->B->save($this->data)
>
> Should be:
> $this->B->saveAll($this->data)
>
>
> http://book.cakephp.org/view/1032/Saving-Related-Mode
As #2will advised, your problem is:
$this->B->save($this->data)
Should be:
$this->B->saveAll($this->data)
http://book.cakephp.org/view/1032/Saving-Related-Model-Data-hasOne-hasMany-belongsTo
HTH, Paul
@phpMagpie
On Sep 15, 2:59 am, Mohd Hasnol wrote:
> edit.ctp
>
> Form->create('B', array('act
edit.ctp
Form->create('B', array('action'=>'edit'));?>
Form->input('A.first_name');
echo $this->Form->input('A.last_name');
echo $this->Form->input('A.contact_no');
echo $this->Form->input('A.email');
echo $this-
Are you doing a saveAll rather than save in your controller?
On Sep 14, 7:27 pm, Mohd Hasnol wrote:
> inside edit.ctp
>
> Form->create('Useradmin', array('action'=>'edit'));?>
> echo $this->Form->input('A.first_name');
> echo $this->Form->input('A.last_nam
inside edit.ctp
Form->create('Useradmin', array('action'=>'edit'));?>
Form->input('A.first_name');
echo $this->Form->input('A.last_name');
echo $this->Form->input('A.contact_no');
echo $this->Form->input('A.email');
ec
a less abstract code example would help
you code post your "real" code. maybe this way we can figure out whats
wrong with your code.
On 14 Sep., 05:35, nOLL wrote:
> Hi,
>
> I have a form that use 2 models(A,B). For create and view function it
> was run perfectly, but there is a problem when edi
Hi,
I have a form that use 2 models(A,B). For create and view function it
was run perfectly, but there is a problem when editing the form. I use
B controller for all the function(CRUD) and i only can edit the B
table attributes but for A attributes the data remain the same.
I follow this http://b
Hi guys,
I'm trying to edit data in related tables (Material hasOne
Book). But by the time to save the data in the table are well edited,
but the system tries to save a new record in paper, instead of
edit.
See code below:
BensController
thanks for your reply. finally i figured it out. for every entry of
the $this->data array i had to supply the id for rows each that should
be updated (i had to insert hidden fields in the form). those who
don't have ids are inserted. that solved my problem, now it's working
like a charm :). thanks
you should reassign the $key value before calling $this->Model->save.
otherwise will assume that you are inserting new row.
hope that'll help
On Mar 23, 1:22 am, misterjinx wrote:
> It's me again. I put validation to false in the saveAll() method, and
> it's half working right now. The main tabl
It's me again. I put validation to false in the saveAll() method, and
it's half working right now. The main table it's updated instead of
inserting a new row, but others are not. It keeps inserting new
records instead of updating those who already exists and inserting new
ones just where's the cas
Hello all,
I've been trying all day long to figure it out an edit action of one
of my controllers, but it just doesn't work. I have a model Contact
which has many Email and Phonenumber. I've created the view, populated
with data from the tables, and proceeded to the edit action. And here
comes th
16 matches
Mail list logo