PHP Sqlserv Multiple Insert from Select

The problem I am facing is converting my PHP script from Mysqli to SqlServ, The code is to look for all the account numbers linked to a userid and then insert them into another data base to then be processed. The for loop i am using works …