zend framework 2 SQL update and insert affected rows (ZF2)
问题 This is a simple question, but I've looked around and couldn't find the answer. How do I extract the number of affected rows from update/insert SQL queries in ZF2? The following code is working nicely for me (it does update), but I would like to perform proper error checks: public function updateSomeField($id, $some_field){ $data = array( 'some_field' => $some_field ); $sql = new Sql($this->dbAdapter); $update = $sql->update(); $update->table('Table1'); $update->set($data); $update->where