flyingfish,

y dont y do like this way

var $uses = array('User', 'Userfield');


        function add() {
$this->User->save($this->data);
$this->Userfield->insertData($this-data);

and in your Userfield model write the query to insert data into the
database like this..

function insertData($arr)
{
      $this->save($arr);
}

if it doesnt work 4 u let me know?


On Oct 1, 7:22 am, flyingfish <[EMAIL PROTECTED]> wrote:
> hi everybody , now i have need to add user information into two
> tables ,one is users,the other is usefields ,
>
> in model , user hasOne usefield
>
> now , i need to insert information into users and userfields at the
> same time,
>
> in my users_controller, i have the code like this
>
>         var $uses = array('User', 'Userfield');
>
>         function add() {
> $this->User->save($this->data);
> $this->Userfield->save($this->data);
>
> }
>
> the problem is , if i use this add method, the code just insert data
> into users tables
>
> for your suggestion and solutions ,thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to