views:

14

answers:

1

Hi,

For a project I need to update a row where the PK contains two columns.

At first I thought I should do it like this but it gives me errors. Anybody with a solution?

$data = array('foo','bar');
$where = $this->_getGateway()->getAdapter()
                    ->quoteInto(array('customerId=?','date=?'), array($comment->customerId, $comment->date));
$this->_getGateway()->update($data, $where);

Thanks

A: 

Got it!

$whereId = $this->_getGateway()->getAdapter()->quoteInto('customerId=?', $comment->customerId);
$whereDate = $this->_getGateway()->getAdapter()->quoteInto('date=?', $comment->date);
$this->_getGateway()->update($data, array($whereId, $whereDate));
baklap