Grid on a different base

I want to display a GridView with data not coming from the default database. I am generating an ActiveDataProvider.

$dataProvider = new ActiveDataProvider([
‘db’ => self::$db0,
‘query’ => $query,

self::$db0 is second base.

And it gave me a message

The table does not exist: SummaryCompany

What am I doing wrong?

So I guess you are sure that SummaryCompany table is there. What is in the query then? Not a lot to say based on the data you gave us.

He’s 100% at second base. As I display the self::$db0 variable points to the correct database. If I change the default configuration to what $db0 points to it’s fine.

Could you show as the query?