Code Duplication    Length = 5-5 lines in 2 locations

class/SmallWorldDB.php 1 location

@@ 632-636 (lines=5) @@
629
        $sql    = 'SELECT value FROM ' . $xoopsDB->prefix('smallworld_settings') . ' WHERE userid = ' . (int)$id . '';
630
        $result = $xoopsDB->queryF($sql);
631
        $i      = $xoopsDB->getRowsNum($result);
632
        if ($i > 0) {
633
            $sql = 'UPDATE ' . $xoopsDB->prefix('smallworld_settings') . " SET value = '" . $posts . "' WHERE userid = " . (int)$id . '';
634
        } else {
635
            $sql = 'INSERT INTO ' . $xoopsDB->prefix('smallworld_settings') . " (userid,value) VALUES ('" . $id . "', '" . $posts . "')";
636
        }
637
        $result = $xoopsDB->queryF($sql);
638
        $this->GetSettings($id);
639
    }

class/SwDatabase.php 1 location

@@ 753-757 (lines=5) @@
750
        $sql    = 'SELECT value FROM ' . $GLOBALS['xoopsDB']->prefix('smallworld_settings') . ' WHERE userid = ' . $id . '';
751
        $result = $GLOBALS['xoopsDB']->queryF($sql);
752
        $i      = $GLOBALS['xoopsDB']->getRowsNum($result);
753
        if ($i > 0) {
754
            $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smallworld_settings') . " SET value = '" . $posts . "' WHERE userid = " . (int)$id . '';
755
        } else {
756
            $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('smallworld_settings') . " (id,userid,value) VALUES ('', '" . $id . "', '" . $posts . "')";
757
        }
758
        $result = $GLOBALS['xoopsDB']->queryF($sql);
759
760
        return $this->getSettings($id);