I don't fully understand what you are trying to do given that you retrieve data from the ''hra_conf" table which I assume is a plugin.
e107 has an in-built function to check if a user belongs to a specific userclass: check_class().
It can be found in /class2.php
Simplest way is to have only one parameter, the class you want to check. Say you want to check if the user belongs to userclass ID 2, you'd do this:
echo "User belongs to class";
echo "User does not belong to class";
You can also insert more parameters. E.g. when you have a a custom userclass list, you can use the second parameter to insert a list (array I think) of all possible values.
Hope this helps.