What error does it through? do you get err-msg?
I think your userlist code is incomplete, the count function in php only returns the elements count of an array and not their assigned values, I am not sure how are you passing the user id in the code you posted the screenshot for, could you paste it here so I can have a better look.?
I believe you need to use a for loop to go through workers, can you just use the exact code that SwimmingTiger posted here >
https://github.com/btccom/btcpool-ABANDONED/issues/16d