src/Origins/BaseModel.php
protected function updateRow()
    {   
        $tableName = $this->getTableName($this->className);
        $assignedValues = $this->getAssignedValues();
        $updateDetails = [];

        for ($i = 0; $i < count($assignedValues['columns']); $i++) { 
            array_push($updateDetails, $assignedValues['columns'][$i]  .' =\''. $assignedValues['values'][$i].'\'');
        }

        $connection = Connection::connect();

        $allUpdates = implode(', ' , $updateDetails);
        $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);
       
        if ($update->execute()) { 
            return 'Row updated';
        } else { 
            throw new Exception("Unable to update row"); 
        }
    }
protected function updateRow()
    {   
        $tableName = $this->getTableName($this->className);
        $assignedValues = $this->getAssignedValues();
        $updateDetails = [];

        for ($i = 0; $i < count($assignedValues['columns']); $i++) { 
            array_push($updateDetails, $assignedValues['columns'][$i]  .' =\''. $assignedValues['values'][$i].'\'');
        }

        $connection = Connection::connect();

        $allUpdates = implode(', ' , $updateDetails);
        $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);
       
        if ($update->execute()) { 
            return 'Row updated';
        } else { 
            throw new Exception("Unable to update row"); 
        }
    }
protected function updateRow ( ) { $ tableName = $ this -> getTableName ( $ this -> className ) ; $ assignedValues = $ this -> getAssignedValues ( ) ; $ updateDetails = [ ] ; for ( $ i = 0 ; $ i < count ( $ assignedValues [ 'columns' ] ) ; $ i ++ ) { array_push ( $ updateDetails , $ assignedValues [ 'columns' ] [ $ i ] . ' =\'' . $ assignedValues [ 'values' ] [ $ i ] . '\'' ) ; } $ connection = Connection :: connect ( ) ; $ allUpdates = implode ( ', ' , $ updateDetails ) ; $ update = $ connection -> prepare ( 'update ' . $ tableName . ' set ' . $ allUpdates . ' where id=' . $ this -> resultRows [ 0 ] [ 'id' ] ) ; if ( $ update -> execute ( ) ) { return 'Row updated' ; } else { throw new Exception ( "Unable to update row" ) ; } }
Edit an existing row

@return bool
Edit an existing row