Code Duplication    Length = 5-5 lines in 2 locations

class/smartdbupdater.php 2 locations

@@ 495-499 (lines=5) @@
492
        foreach ($this->getUpdatedFields() as $updatedField) {
493
            $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']);
494
            $ret   = $ret && $xoopsDB->query($query);
495
            if (!$ret) {
496
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br />';
497
            } else {
498
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br />';
499
            }
500
        }
501
502
        return $ret;
@@ 520-524 (lines=5) @@
517
            $query = sprintf('UPDATE %s SET %s = %s WHERE %s  %s', $this->name(), $updatedWhere['name'], $updatedWhere['value'], $updatedWhere['name'], $updatedWhere['where']);
518
            //echo $query."<br>";
519
            $ret = $ret && $xoopsDB->query($query);
520
            if (!$ret) {
521
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br />';
522
            } else {
523
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br />';
524
            }
525
        }
526
527
        return $ret;