Hi all,
For some reason I cannot get this to work, but I know there is
something simple I am overlooking.
I have a function in my model which should find all records with a
certain criteria (in this case, those records whose 'printed' field is
'N') and then update those records (changing 'printed' to 'Y'). The
code I have been trying is below. What is happening is that only the
first record is updated. I though unsetting the id would solve that
problem, but it does not.
function updatePrintStatus(){
$ret = $this->findByPrinted('N');
foreach($ret as $row){
$this->id = $row['id'];
$this->save(array('printed'=>'Y'));
unset($this->id);
}
}
Any thoughts?
thanks,
dave
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---