php - Data from two tables in view using single controller in code ignitor
one text
I have two tables one Customer and second transactions UID( User ID) and CID (Campaign ID) are common in both tables. I want result as shown in screenshot.
My Controller contains
public function index()
{
$result['campaigns'] = $this->campaign_logs->campaigndetails($uid); // Getting all campaigns for UID
$this->load->view( 'dashboard',$result );
}
By this I am able to pull up campaigns but now I want all count(transactions) for each campaign in dashboard view as mentioned in screenshot.
Problem is one UID can contain many CID's and each CID contains variable transactions. how I can pass cid to pulp results.
Any suggestion how to do this?
Source