Picking up multiple fields from a joined list

On a volunteer registration form that I preparing, I have the usual database join drop down to pick up the id of the opportunity that they registering for. I display the title of the id.
I also need to pickup but not display the email address of the contact for the opportunity for use in the sendto of the EMAIL plugin
Can you suggest the easiest way to get that?
 
Use the Email to (eval) instead of Email to, run a query do get the info you need.

Code:
$db =& JFactory::getDBO();
$query = "SELECT `email` FROM `contacts` WHERE `id` = {contacts___name_raw}";
$db->setQuery($query);
$result = $db->loadResult();
return $result;

Obviously I making up the query above but you'll probably only need to change a couple of bits on line two.

I assume this is the route you want to take as your previous post was talking about dummy fields so I assume you don't want to store the value.
 
Works like a charm. I note that the prefix substitution does not seem to work on the query (i.e., I tried two underscores at the beginning of the table).
 
Correct, when you are dealing with queries like this you are using the real mysql names opposed to the Fabrik ones. You can however still use placeholders, ooh hang on that maybe what you mean, it's actually three underscores.


Writing it as I think it. :)
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top