Perhaps I need to be more specific.  I am importing the data from a
.csv file, so I am building the data structure myself, and the
information from the Manual does not explain how to create a data
structure for multiple hasMany records. So far I have managed to save
Member records, and I had no trouble creating links to Categories
through a hasAndBelongsToMany association.  I have tried both

$this->Member->Individual->save($record);

and

$this->Individual->save($inds_record);

and neither worked, so there must be something wrong with my data
structure or my code.

Here is one data structure, I tried:

$record = array(
  "Member"=>array(
    "id" = "",
     ...
    "Category"=>array(
      "Category"=>array(
        [0] = $category_id[0],
        ...
      )
    )
    "Individual"=>array(
      "id" = "",
      "individual_name" = $inds[$i]
    )
  )
)

and it didn't work.  Also even if it did work,  what would happen if I
looped through $i?  I suspect I would end up with a bunch of duplicate
Member records.

So, I tried just saving Individuals:

$inds_record = array(
  "Individual"=>array(
    "id" = "",
    "individual_name" = $inds[$i]
  )
)

and that didn't work either.  I haven't starting using
getLastInsertId() yet, but I am going to add that today, but I suspect
I am just missing something simple.  Any suggestions?


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

Reply via email to