• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matching data from 2 table with validation date

#5
(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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.