if(userIds!=null && !userIds.isEmpty()){
DotConnect dc = new DotConnect();
dc.setSQL("select tagname, user_id from tag where user_id is not null");
//Gets all the tags from DB that are not null.
List<Map<String, Object>> results = (ArrayList<Map<String, Object>>)dc.loadResults();
//Checks each of the tag to see if match any of the users in the list.
for (int i = 0; i < results.size(); i++) {
Map<String, Object> hash = (Map<String, Object>) results.get(i);