code: public function set($arrParams)
  	{
  		$strQuery = '';
  		$arrParams = $this->escapeParams($arrParams);
  
  		// INSERT
  		if (strncasecmp($this->strQuery, 'INSERT', 6) === 0)
  		{
  			$strQuery = sprintf('(%s) VALUES (%s)',
  								implode(', ', array_map('Database::quoteIdentifier', array_keys($arrParams))),
  								str_replace('%', '%%', implode(', ', $arrParams)));
  		}
  
  		// UPDATE
  		elseif (strncasecmp($this->strQuery, 'UPDATE', 6) === 0)
  		{
  			$arrSet = array();
  
  			foreach ($arrParams as $k=>$v)
  			{
  				$arrSet[] = Database::quoteIdentifier($k) . '=' . $v;
  			}
  
  			$strQuery = 'SET ' . str_replace('%', '%%', implode(', ', $arrSet));
  		}
  
  		$this->strQuery = str_replace('%p', $strQuery, $this->strQuery);
  
  		return $this;
  	}
docs: Autogenerate the SET/VALUES subpart of a query from an associative array
  
  Usage:
  
  $set = array(
  'firstname' => 'Leo',
  'lastname'  => 'Feyer'
  );
  $stmt->prepare("UPDATE tl_member %s")->set($set);
  
  @param array $arrParams The associative array
  
  @return Statement The statement object