Ok, that makes more sense now. The function is working just fine, it's just not getting any variables from the db. I'd try two things.
Under global $userlists make another global variable. Something like $one = "1";
Then, inside of each table, echo the following
One equals $one
That should echo (since you made it global). If it does, then you may want to try for testing purposes making each specific key in the array global
global $userslist["name"];
global $userlists["type"];
and see if that works. I've never ran into this problem before, but playing around with things like that is how I would go about solving it. The query is obviously working because it created as many tables as there were results, the problem is the values just aren't getting passed. Try the above and let me know if that gets you anywhere or solves the problem.
Cgraz