database query based on HTML classes