2009年2月5日星期四

Re: [fw-db] Transactions: Possible to Insert and Update same row in one trans?

it seems I am getting the id already using $id=$this->_db->lastinsertID();

but when I try to do this:
$this->_db->update('revisions', array('fid' => $record_id), 'WHERE id ='.
$id);

within the same trans, i get an error.

PHPScriptor wrote:
>
> The insert is returning the id. So something likes this
>
> $myModel = new myModel();
> $id = $myModel->insert($data);
> $myModel->update($newdata, 'id='.$id);
>
>

--
View this message in context: http://www.nabble.com/Transactions%3A-Possible-to-Insert-and-Update-same-row-in-one-trans--tp21861186p21861719.html
Sent from the Zend DB mailing list archive at Nabble.com.

没有评论: