Dear Easy Profile
I try to access the jsn records by 2 ways and I do not succeed. I need help.
------------By Table Query
$queryref1 = $db
->getQuery(true)
->select($db->quoteName('choose_referral'))
->from($db->quoteName('#__jsn_users'))
->where($db->quoteName('id') . " = " . $userId);
$db->setQuery($queryref1);
$referralemail140 = $db->loadResult();
//I want to display the results
JFactory::getApplication()->enqueueMessage(JText::_($queryref1), 'Message');
JFactory::getApplication()->enqueueMessage(JText::_($referralemail140), 'Message');
$queryref1 is displayed
SELECT `choose_referral` FROM `#__jsn_users` WHERE `id` = 771
The second line with $referralemail140 is not displayed
I tested
->where($db->quoteName('id') . " = " . $db->quote($userId));
SELECT 'choose_referral' FROM `#__jsn_users` WHERE `id` = '771'
The second line with $referralemail140 is not displayed
-----------By JsnHelper
At the beginning of the php I declared
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
and tried
$userjsn=JsnHelper::getUser($userId);
$userjsn=JsnHelper::getUser(); echo $userjsn->getValue('choose_referral');
Nothing happens
$userjsnrefmail = $userjsn->->getValue('choose_referral');
It occurs unexpected '->' (T_OBJECT_OPERATOR)
Please, how can I get the value of the 'choose_referral' field in a variable?.