KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

QueryBuilder - two joins of the same table. #1033

Open SOFMAN opened this topic on on Aug 7 - 1 comments

SOFMAN commented on Aug 7

I need to do two joins with the same table, I have tried to assign an alias to each table as shown in the code but it is not possible I get an error. How can I add an alias to each table?

$this->src("mysql")->query(MySQL::type( DB::table('cuenta_cobrar')
            ->join('vendedor as v1', 'cuenta_cobrar.vendedor', '=', 'v1.id')
            ->join('vendedor as v2', 'cuenta_cobrar.recaudador', '=', 'v2.id'))
KoolReport commented on Aug 10

Could you please locate the koolreport/querybuilder/MySQL.php file and put following content:


namespace koolreport\querybuilder;

class MySQL extends SQL
    protected $indentifierCover=array("","");

Try again and let me know if it works.

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
help needed