Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 682-688 (lines=7) @@
679
            $tableDef = &$this->tables[$table];
680
            $colSql = '';
681
            $valSql = '';
682
            foreach ($tableDef['columns'] as $col) {
683
                $comma=empty($colSql)?'':', ';
684
                if (isset($columns[$col['name']])) {
685
                    $colSql .= $comma.$col['name'];
686
                    $valSql .= $comma.$this->db->quote($columns[$col['name']]);
687
                }
688
            }
689
            $sql = "INSERT INTO `{$tableDef['name']}` ({$colSql}) VALUES({$valSql})";
690
            $this->queue[]=$sql;
691
@@ 721-727 (lines=7) @@
718
                $where = $criteria->renderWhere();
719
            }
720
            $colSql = '';
721
            foreach ($tableDef['columns'] as $col) {
722
                $comma=empty($colSql)?'':', ';
723
                if (isset($columns[$col['name']])) {
724
                    $colSql .= $comma . $col['name'] . ' = '
725
                        . $this->db->quote($columns[$col['name']]);
726
                }
727
            }
728
            $sql = "UPDATE `{$tableDef['name']}` SET {$colSql} {$where}";
729
            $this->queue[]=$sql;
730