Code Duplication    Length = 5-5 lines in 2 locations

class/DbTable.php 2 locations

@@ 500-504 (lines=5) @@
497
        foreach ($this->getUpdatedFields() as $updatedField) {
498
            $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']);
499
            $ret   = $ret && $xoopsDB->query($query);
500
            if (!$ret) {
501
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>';
502
            } else {
503
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>';
504
            }
505
        }
506
507
        return $ret;
@@ 523-527 (lines=5) @@
520
            $query = sprintf('UPDATE %s SET %s = %s WHERE %s  %s', $this->name(), $updatedWhere['name'], $updatedWhere['value'], $updatedWhere['name'], $updatedWhere['where']);
521
            //echo $query."<br>";
522
            $ret = $ret && $xoopsDB->query($query);
523
            if (!$ret) {
524
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . ' (' . $xoopsDB->error() . ')<br>';
525
            } else {
526
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>';
527
            }
528
        }
529
530
        return $ret;