Why not use just IN?
That would save you some comparisons:
```
    WHERE id_member IN ({array_int:loaded_ids})
      AND variable IN ({array_string:params})',
```

and here below:
```
      'loaded_ids' => $users,
      'params' => $params,
```