Re: User Id Updating

2009-05-05 Thread andy

I believe it is updating because the id value is set. If Cake's save
function picks up a id value through POST, it will update the
appropriate field rather than save a new one. Is the id that you set
in the controller accessed as $user['id'] or $user['User']['id'] in
the view? Try giving the Auth id a different name in the controller.

On May 1, 12:11 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
 I am debugging a save
 debug($this-User-save($this-data[$model_table], true,
 array_keys($this-User-$join_table-schema(;

 Everything is working fine in regards to the save except in the debug array
 I see User id...and in the SQL log I see

 UPDATE `users` SET `id` = 3 WHERE `users`.`id` = 3

 Array
 (
     [User] = Array
         (
             [id] = 3
         )

     [System] = Array
         (
             [0] = 3
             [1] = 5
             [2] = 4
             [3] = 6
             [4] = 1
             [5] = 2
             [6] = 3
             [7] = 5
             [8] = 4
             [9] = 6
             [10] = 1
             [11] = 2
         )

 )
 I have nothing in the controller relating to the User.id except
 $this-User-id = $this-Auth-user('id');
 $this-set('user', $this-User-read('id', $this-Auth-user('id')));

 Why is updatng? Any ideas?

 thanks

 Dave

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



User Id Updating

2009-04-30 Thread Dave Maharaj :: WidePixels.com

I am debugging a save
debug($this-User-save($this-data[$model_table], true,
array_keys($this-User-$join_table-schema(;
 
Everything is working fine in regards to the save except in the debug array
I see User id...and in the SQL log I see

UPDATE `users` SET `id` = 3 WHERE `users`.`id` = 3
 
Array
(
[User] = Array
(
[id] = 3
)

[System] = Array
(
[0] = 3
[1] = 5
[2] = 4
[3] = 6
[4] = 1
[5] = 2
[6] = 3
[7] = 5
[8] = 4
[9] = 6
[10] = 1
[11] = 2
)

)
I have nothing in the controller relating to the User.id except 
$this-User-id = $this-Auth-user('id');
$this-set('user', $this-User-read('id', $this-Auth-user('id')));

Why is updatng? Any ideas?

thanks
 
Dave


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---