Implement insert and update functions using Zend Db query builder.