I have a report form that has a list of people who attended an event.
When I try to save the attendees, the first one is added to the db, the
rest attempt to update with the id of the event.

here is an idea of the data:

$this->data['event']=array(
     'title'=>'title of event',
     'date'=>'12/12/2006',
     'attendees'=>array(
          [0]=>array(
               'name'=>'sara lemming',
               'title'=>'queen bee'
          ),
          [1]=>array(
               'name'=>'joe schmoe',
               'title'=>'worker bee'
          )
     )
)

Before I save, I copy the attendees array to another variable
($attendees) and then unset the 'attendees' element from the data
array.  The data array then saves ok.

Then I do a 'foreach' on the $attendees array and save each to the
proper model.  The first one is inserted into the db.  Then there is a
'select count' sql that is looking for the id of insert of the data
array.  Then the rest of the $attendees try to update based on that id.

What am I doing wrong?


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to