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

Issue with multiple join

return $this->modelsManager->createBuilder() ->columns('Channels.apiKey') ->from('Channels') ->innerJoin('SspChannelAd', 'Channels.ssp_channel_ad_id = SspChannelAd.id ') ->innerJoin('SspChannel', 'SspChannelAd.channel_id = SspChannel.id') ->where('SspChannel.publisher_id=1') ->getQuery() ->execute() ->toArray();

return $this->modelsManager->createBuilder() 
    ->columns('Channels.apiKey')
    ->from('Channels')
    ->innerJoin('SspChannelAd', 'Channels.sspchannelad_id = SspChannelAd.id ')
    ->innerJoin('SspChannel', 'SspChannelAd.channel_id = SspChannel.id')
    ->where('SspChannel.publisher_id=1')
    ->getQuery() ->execute() ->toArray();

But what is the error? Does it stop with an exception, do you get bad results?

Yes It's stop with an exception.

And what does the exception say? If you want some help, you'd better provide all the info that's necessary :]