We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

sonething about left join!!!

    $result = $this->modelsManager->createBuilder()
        ->from('Aops\Apps\Admin\Models\TeamsWechats')
        ->leftjoin('Aops\Apps\Admin\Models\Teams','[Aops\Apps\Admin\Models\TeamsWechats].tid=p.team_id', "p")
    ->getPhql();
    var_dump($result);
    it shows  "SELECT [Aops\Apps\Admin\Models\TeamsWechats].* FROM [Aops\Apps\Admin\Models\TeamsWechats] LEFT JOIN [Aops\Apps\Admin\Models\Teams] AS [p] ON [Aops\Apps\Admin\Models\TeamsWechats].tid=p.team_id"
    then i run 
            $result = $this->modelsManager->createBuilder()
        ->from('Aops\Apps\Admin\Models\TeamsWechats')
        ->leftjoin('Aops\Apps\Admin\Models\Teams','[Aops\Apps\Admin\Models\TeamsWechats].tid=p.team_id', "p")
        ->getQuery()
        ->execute();
        dd($result);
    it shows nothing!!!
    why doesn't it work???
edited Oct '16

Add sql logging and just test this sql query on phpmyadmin or in cli. Also what you mean by nothing ? Like NULL or what ? Is there any exception ? Error 500 request ? Check php logs.



9.6k
edited Oct '16

Error 500 request

edited Oct '16

Then check logs.