1. Hugh (cheesegrits) here. Thank you for all the good wishes. My back surgery was a success, post-op recovery is going well, and I'm getting stronger and feeling better every day. I hope to be getting back in the saddle and working support again over the next few days.
  2. IMPORTANT NOTE - we have made some changes in our github branch naming. The 'master' branch no longer exists, and is now called 'joomla25' (which is Fabrik 3.0). The 'joomla3' branch (which is Fabrik 3.2) remains unchanged. We have also removed all the other testing branches which had accuulated over the last few years. I have posted a thread in the Community forum for 3.0 with some more information, feel free to as questions there.

How to retrieve values from another form and use as the default valuel for a field

Discussion in 'Subscriber Support' started by steemer473, Dec 19, 2010.

  1. steemer473 New Member

    Level: Community
    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
  2. rob Administrator

    Level: Community
    looks correct to me.
    After your $db->setQUeyr();

    add

    echo $db->getQuery();exit;

    to see what the query is that is being run.
    Then paste that into phpMyAdmin to see whether an error is reported or if the data is correctly returned.

Share This Page