Not sure if I understood your problem, but in case you want to add
some data to the profiles inside the foreach and save it to the DB,
this could look like:
$profiles = $this->Profile->find('all');
foreach($profiles as $nr => $profile) {
..
$profiles[$nr]['Profile']['new_attribute'] = some_value;
..
}
$this->Profile->saveAll($profiles);
Hope this helps.
Mr K schrieb:
> Help ... :)
>
> Okay .. so I have a problem & I need some help.
>
> I have a users table & a profile table. A user can have multiple
> profiles.
> Okay simple enough - I've got that bit working (user rego/login etc &
> creating base profiles)
>
> So once I have their base profile info I run some scripts (will later
> be cron run) to fill in more detail.
> So, I look up their profiles (lets pretend they have 3) and foreach I
> run through and fetch information.
>
> My Profiles Controller of course has the functions Add, Edit etc, also
> have a function called FetchProfile, which then I have a specific
> function for each profile I need to fetch (at this stage 3 functions)
>
> What I'm really struggling with is, I can use
>
> foreach($this->Profile as $profile) {
> ... code here
> }
>
> to get and cycle through ...
> how the heck to I put it back into the database?
>
> I of course no longer have a profile object to simply save() ... I
> can't find anything on the cakePHP sites about how to do something
> like
>
> UPDATE table WHERE id='id' SET .......
>
> grrr .. I love the CakePHP framework ... but this is frustrating ..
> I'm sure it's a simple thing!! Help!
>
> Thanks all
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---