Update controller.php

Build up an array of rows to update to prevent locking on MSSQL.
Merge pull request #6 from JimMackin/patch-1

Update controller.php