Code Duplication    Length = 13-13 lines in 3 locations

class/db.php 1 location

@@ 117-129 (lines=13) @@
114
     * @param string $var
115
     * @return array|int
116
     */
117
    public function getVar($id, $var)
118
    {
119
        global $xoopsUser, $xoopsDB;
120
        $sql    = 'SELECT ' . $var . ' FROM ' . $xoopsDB->prefix('smallworld_user') . " WHERE userid = '" . $id . "'";
121
        $result = $xoopsDB->queryF($sql);
122
        if ($xoopsDB->getRowsNum($result) < 1) {
123
            return 0;//_SMALLWORLD_REPLY_NOTSPECIFIED;
124
        }
125
        while ($row = $xoopsDB->fetchArray($result)) {
126
            $msg[$var] = $row[$var];
127
        }
128
        return $msg[$var];
129
    }
130
131
    /**
132
     * updateSingleValue function

class/SmallWorldDB.php 1 location

@@ 119-131 (lines=13) @@
116
     * @param string $var
117
     * @return array|int
118
     */
119
    public function getVar($id, $var)
120
    {
121
        global $xoopsUser, $xoopsDB;
122
        $sql    = 'SELECT ' . $var . ' FROM ' . $xoopsDB->prefix('smallworld_user') . " WHERE userid = '" . $id . "'";
123
        $result = $xoopsDB->queryF($sql);
124
        if ($xoopsDB->getRowsNum($result) < 1) {
125
            return 0;//_SMALLWORLD_REPLY_NOTSPECIFIED;
126
        }
127
        while ($row = $xoopsDB->fetchArray($result)) {
128
            $msg[$var] = $row[$var];
129
        }
130
        return $msg[$var];
131
    }
132
133
    /**
134
     * updateSingleValue function

class/SwDatabase.php 1 location

@@ 144-156 (lines=13) @@
141
     * @param string $var
142
     * @returns Array
143
     */   
144
    function getVar($id, $var)
145
    {
146
        global $xoopsUser, $xoopsDB;
147
        $sql = "SELECT ".$var." FROM ".$xoopsDB->prefix('smallworld_user')." WHERE userid = '".$id."'";
148
        $result = $xoopsDB->queryF($sql);
149
        if ($xoopsDB->getRowsNum($result) < 1) {
150
            return 0;//_SMALLWORLD_REPLY_NOTSPECIFIED;
151
        }
152
            while ($row = $xoopsDB->fetchArray($result)) { 
153
                $msg[$var] = $row[$var];
154
            }
155
            return $msg[$var];
156
    }
157
    
158
159
    /**