I created a Code field and, as a test, inserted the following:
$userid = $user->get('id');
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery
->select(array('hostregion', 'hostshichousonjpn','hostactivities'))
->from('#__fab_host_profile')
->where('user_id = '.(int)$userid);
$myDb->setQuery($myQuery);
$row = $myDb->LoadObject();
The result on the front end is blank:
I debugged by adding the following code:
echo $myQuery;
var_dump($row);
exit;
And the result was:
SELECT hostregion,hostshichousonjpn,hostactivities FROM #__fab_host_profile WHERE user_id = 540object(stdClass)#1567 (3) { ["hostregion"]=> string(10) "_F_TOHOKU_" ["hostshichousonjpn"]=> string(9) "鹿角市" ["hostactivities"]=> string(27) "["_F_GENFARMINGKNOWLEDGE_"]" }
Can someone advise me what I need to do to have the data display properly?