SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

hello guys.

I cant filter from index gridview, this is the error:

SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens

The SQL being executed was: SELECT COUNT(*) FROM competencia_estado INNER JOIN (SELECT * FROM competencia) competencia ON competencia.id=competencia_estado.competencia_id INNER JOIN (SELECT * FROM estado) estado ON estado.id=competencia_estado.estado_id INNER JOIN evento ON evento.id=competencia.evento_id INNER JOIN disciplina ON disciplina.id=competencia.disciplina_id WHERE disciplina.nombre LIKE ‘% nombre%’

this is the code:

public function search($params)

{


    $query = CompetenciaEstado::find();


    $subQueryEvento=Evento::find();


    $subQueryEstado=Estado::find();;


    $subQueryDisciplina=Disciplina::find()->where(['oden'=>1]);


    $subQueryCompetencia = Competencia::find();


    $query->innerJoin(['competencia'=>$subQueryCompetencia],'competencia.id=competencia_estado.competencia_id')      


           ->innerJoin(['estado'=>$subQueryEstado],'estado.id=competencia_estado.estado_id')


           ->innerJoin(['evento',$subQueryEvento],'evento.id=competencia.evento_id')


           ->innerJoin(['disciplina',$subQueryDisciplina],'disciplina.id=competencia.disciplina_id');


    $dataProvider = new ActiveDataProvider([


        'query' => $query,


    ]);


    


      $dataProvider->setSort([


        'attributes' => [


            'id',


            'estado' => [


                'asc' => ['estado.nombre' => SORT_ASC],


                'desc' => ['estado.nombre' => SORT_DESC],


                'label' => 'Estado',


            ],


            'evento' => [


                'asc' => ['evento.nombre' => SORT_ASC],


                'desc' => ['evento.nombre' => SORT_DESC],


                'label' => 'Evento',


            ],


            'disciplina' => [


                'asc' => ['disciplina.nombre' => SORT_ASC],


                'desc' => ['disciplina.nombre' => SORT_DESC],


                'label' => 'Disciplina',


            ]


        ]


    ]);


    


    


    





    $this->load($params);





    if (!$this->validate()) {


        // uncomment the following line if you do not want to any records when validation fails


        // $query->where('0=1');


        return $dataProvider;


    }





    $query->andFilterWhere([


        'id' => $this->id,           


    ]);


    


    $query->andFilterWhere(['like', 'disciplina.nombre', $this->disciplina]);


    


    


    return $dataProvider;


}

}

I dont now what happend…

If I take the query throw by the error, I can run it in mysql.

thanks

I fixed with that

$subQueryDisciplina=Disciplina::find([‘orden’=>1]);

I had writen bad the name of one field.