KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

How To use join for three tables #1920

Open ankit opened this topic on on Feb 23, 2021 - 2 comments

ankit commented on Feb 23, 2021

Hi please tell me how to use join for more two tables data

$user_source = $this->src('user_source')->query("select id,name from users");
$purchase_source = $this->src('purchase_source')->query("select user_id,item,amount from purchases");
$join = new Join($user_source,$purchase_source,array("id"=>"user_id"));
$join->pipe($this->dataStore('together'));
ankit commented on Feb 26, 2021

please help

KoolReport commented on Mar 1, 2021

Hi Ankit,

You apply the same concept to join the third table.

$user_source = $this->src('user_source')->query("select id,name from users");
$purchase_source = $this->src('purchase_source')->query("select user_id,item,amount from purchases");
$join = new Join($user_source,$purchase_source,array("id"=>"user_id"));
$together = new Join($join,$another_source,array("id"=>"user_id"));
$together->pipe($this->dataStore('together'));

Hope that helps.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None