Zend Framework - Update a Database row with WHERE and AND

jiania

New Member
To use \[code\]where\[/code\] in a MySQL table row update in Zend Framework I have something like:\[code\]public function updateBySiteId(array $data, $id) { $table = $this->gettable(); $where = $table->getAdapter()->quoteInto('site_id = ?', $id); return $table->update($data, $where); }\[/code\]and this, I expect, gives me something like...\[code\]UPDATE foo SET ponies = 'sparkly' WHERE site_id = '1'\[/code\]But what if I want to create the following:\[code\]UPDATE foo SET ponies = 'sparkly' WHERE site_id = '1' AND type = 'zombie'\[/code\]In the manual I don't see how to do this with quoteInto (or quote or some other safe method... which could just mean I'm looking in the wrong place but... sigh).
 
Back
Top