AnsweredAssumed Answered

How can I convert this SQL query to bean format?

Question asked by nigel_john nigel_john on Apr 11, 2014
Latest reply on Apr 14, 2014 by Francesca Shiekh
Hi,

This should be simple.

I need to convert this SQL query to bean format.

"SELECT first_name, last_name FROM leads INNER JOIN  contacts_leads_1_c  ON leads.id=contacts_leads_1_c.contacts_leads_1leads_idb  where contacts_leads_1_c.contacts_leads_1contacts_ida='".$bean->id."'";

I have this already in place

$lead = new Lead();
$where = "contacts_leads_1_c.contacts_leads_1contacts_ida = '$bean->id' ";
$lead_list = $lead->get_full_list("", $where,true);
$all_leads = array();
foreach($all_leads as $leads){
$bean->contacts_leads = $ref->first_name . ',' . $ref->last_name;

This is the problem
$lead_list = $lead->get_full_list("", $where,true);

Thanks in advance.
John

Outcomes