i have a model name Vendor.
class Vendor extends AppModel
{
    var $name = 'vendor';
        var $hasMany = array(
        'VendorProduct' => array(
            'className'     => 'VendorProduct',
            'foreignKey'    => 'vendor_id',
            'dependent'=> true
        )
    );
}
i have created a function upload in the controller
function upload()
{
   //first part
                $obj_Vendor = new Vendor();
                $obj_Vendor->save($theData);
   //second part
                $theData = Array('Vendor' => Array('name' => 'test1'));
                $this->Vendor->save($theData);

}

Actually the problem is the second part is working correctly. But the
first is not.
The problem i have more than one row to be inserted. when i am doing
through the second way it's actually updating instead of inserting.
Could anyone help me??? Thanks in advance

--~--~---------~--~----~------------~-------~--~----~
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