$tagcheck = $vbulletin->db->query_first(" SELECT fieldX FROM " . TABLE_PREFIX . "userfield WHERE fieldX = " . $vbulletin->userinfo['fieldx'] . " LIMIT 1");if (empty($tagcheck)){ // tag is not used by anyone}