Welcome Guest, Not a member yet? Register   Sign In
Matching data from 2 table with validation date
#5

(This post was last modified: 02-08-2019, 08:34 AM by DELE.)

(02-07-2019, 04:35 PM)php_rocs Wrote: @DELE,

users_campaigns_join could be a view or a query (subset of data).  I just used the name to represent the data.

Like below...
PHP Code:
select ucj.id
from users_campaigns_join_view ucj
inner join incomes i on i
.id ucj.id
where i
.date '2018-10-10' 

I do not really understand your point.

this is the code that I use to produce (what you call) ucj.
PHP Code:
public function test1()
{
    $this->db->select();
    $this->db->from('users');
    $this->db->join('campaigns''campaigns.id = users.id');
    $res $this->db->get();

    foreach ($res->result() as $key) {
 
      echo $key->ID.'<br>';
    }
}

// Results
// 00001
// 00005
// 00008 

how to implement your method using this method?
PHP Code:
public function test2()
{
    $this->db->select();
    $this->db->from('???'); // how to implement your method here?
    $this->db->join('incomes''incomes.id = ???.id');
    $this->db->where(???);

    $res $this->db->get();
    foreach ($res->result() as $key) {
 
      echo $key->ID.'<br>';
    }
}

// So the results can be like this
// 005
// 008 
Reply


Messages In This Thread
RE: Matching data from 2 table with validation date - by DELE - 02-08-2019, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB