Code Duplication    Length = 7-8 lines in 2 locations

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

@@ 632-639 (lines=8) @@
629
            $tableDef = $this->tables[$table];
630
            $colSql = '';
631
            $valSql = '';
632
            foreach ($tableDef['columns'] as $col) {
633
                $comma = empty($colSql) ? '' : ', ';
634
                if (isset($columns[$col['name']])) {
635
                    $colSql .= "{$comma}`{$col['name']}`";
636
                    $valSql .= $comma
637
                        . ($quoteValue ? $this->db->quote($columns[$col['name']]) : $columns[$col['name']]);
638
                }
639
            }
640
            $sql = "INSERT INTO `{$tableDef['name']}` ({$colSql}) VALUES({$valSql})";
641
            $this->queue[] = $sql;
642
@@ 670-676 (lines=7) @@
667
                $where = $criteria->renderWhere();
668
            }
669
            $colSql = '';
670
            foreach ($tableDef['columns'] as $col) {
671
                $comma = empty($colSql) ? '' : ', ';
672
                if (isset($columns[$col['name']])) {
673
                    $colSql .= "{$comma}`{$col['name']}` = "
674
                        . ($quoteValue ? $this->db->quote($columns[$col['name']]) : $columns[$col['name']]);
675
                }
676
            }
677
            $sql = "UPDATE `{$tableDef['name']}` SET {$colSql} {$where}";
678
            $this->queue[] = $sql;
679