Moved sql for changing docManid column in mediafiles to an sql update file. Removed the function from the php update file.