/** * 执行SQL语句 * * @param string|Zend_Db_Select $sql * @param boolean $commit * @return integer */ protected function _exec($sql, $commit = true) { $affected = $this->_db->exec($sql); if ($commit) { $this->_db->exec('COMMIT'); } return $affected; }