When user is logged in, his extra information (custom field values) is attached to his user object. You can access it like:

$user = JFactory::getUser();
print_r($user->extra);

For example, to access your field with label companyName you will do it with:

$user->extra['companyName'];

If you want to get extra info for different users (other than the logged in one) you can do something like this:

$user = JFactory::getUser($userid);
plgSystemAJAXRegister::attachExtraFields($user);
print_r($user->extra);

About us

We provide high quality Joomla components created by a co-founder and original core developer of Joomla. For over a decade, our products have been used by more than 20.000 webmasters around the world.

Stay in touch