function insert($tableName, $arValues) {
   $id = null;
   $sFieldList = join(', ', array_keys($arValues));
   $arValueList = array();

   foreach($arValues as $value) {
      if(strtolower($value) == '#id#') {
         // pobiera nastpn warto sekwencji
         $value = $id = $this->conn->nextID($tableName . "_id");
      }
      $arValueList[] = $this->conn->quoteSmart($value);
   }
   $sValueList = implode(', ', $arValueList);

   // cytowanie nazwy tabeli
   $tableName = $this->conn->quoteIdentifier($tableName);

   $sql = "INSERT INTO $tableName ( $sFieldList) VALUES ( $sValueList )";
   $result = $this->conn->query($sql);

   if(DB::isError($result)) {
      throw new Exception($result->getMessage(), $result->getCode());
   }

   // zwraca identyfikator, jeli istnieje, w przeciwnym wypadku liczb wierszy
   return $id ? $id : $this->conn->affectedRows();
}