Dataobject update during fetch
| From: | Mike Carter | Date: | Thu, 31 Jul 2003 13:18:40 +0000 |
| Subject: | Dataobject update during fetch | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-6928@lists.php.net to get a copy of this message | ||
Hi,
I'm attempting to loop through a table of records and update each record with a
new value in one of its fields.
However this is causing a DataObject error:
ERROR update: No Data specifed for query title = 'Mr' , surname = 'Carter' ,
firstname = 'Mike' , email = 'mcarter@ablip.com' , emailack = 1059656428 ,
My code goes as follows:
// --- Only extract the columns we need for this email spam
$this->selectAdd();
$this->selectAdd('email,title,firstname,surname,emailack');
$totalPeople = $this->find();
while ($this->fetch()) {
if($mailObj->send($this->email, $hdrs, $body)) {
echo "{$this->title} {$this->firstname} {$this->surname}
<{$this->email}><br>";
$this->emailack = time();
if(!$this->update()) {
echo $this->_lastError->getMessage();
}
}
--
http://www.buddasworld.co.uk
----------------------------------------------
This mail sent through http://www.ukonline.net