Code Duplication    Length = 7-7 lines in 2 locations

htdocs/xoops_lib/Xmf/Database/Tables.php 2 locations

@@ 656-662 (lines=7) @@
653
            $tableDef = $this->tables[$table];
654
            $colSql = '';
655
            $valSql = '';
656
            foreach ($tableDef['columns'] as $col) {
657
                $comma = empty($colSql) ? '' : ', ';
658
                if (isset($columns[$col['name']])) {
659
                    $colSql .= $comma . $col['name'];
660
                    $valSql .= $comma . $this->db->quote($columns[$col['name']]);
661
                }
662
            }
663
            $sql = "INSERT INTO `{$tableDef['name']}` ({$colSql}) VALUES({$valSql})";
664
            $this->queue[] = $sql;
665
@@ 692-698 (lines=7) @@
689
                $where = $criteria->renderWhere();
690
            }
691
            $colSql = '';
692
            foreach ($tableDef['columns'] as $col) {
693
                $comma = empty($colSql) ? '' : ', ';
694
                if (isset($columns[$col['name']])) {
695
                    $colSql .= $comma . $col['name'] . ' = '
696
                        . $this->db->quote($columns[$col['name']]);
697
                }
698
            }
699
            $sql = "UPDATE `{$tableDef['name']}` SET {$colSql} {$where}";
700
            $this->queue[] = $sql;
701