steemer473
Member
I am trying to retrieve values from Form B in order to prepopulate Form A. I am not a programmer so please bear with me. Below is the php code I am using.
$db = JFactory::getDBO();
$user = JFactory::getUser();
$userid = $user->get('id');
$db->setQuery("
SELECT jos_Agents.agent_type
FROM `jos_Agents` WHERE jos_RFC.user_id =$userid");
$results = $db->loadResult();
return $results;
This code is what I am using to retrieve the value of the agent_type field. When I load the form, the field is blank. I'm not seeing what is wrong with this expression. Can you identify why this isn't working
$db = JFactory::getDBO();
$user = JFactory::getUser();
$userid = $user->get('id');
$db->setQuery("
SELECT jos_Agents.agent_type
FROM `jos_Agents` WHERE jos_RFC.user_id =$userid");
$results = $db->loadResult();
return $results;
This code is what I am using to retrieve the value of the agent_type field. When I load the form, the field is blank. I'm not seeing what is wrong with this expression. Can you identify why this isn't working