php - set two parameters in a query builder symfony -


i want set 2 parameters $type , $superior in query builder

$qb->select('a')      ->from('xxxbundle:entity', 'a')      ->where('a.typepro = :type')      ->andwhere('a.superior=: superior')      ->setparameter('type', $type)      ->setparameter ('superior',$superior); 

but failed appropriate result , following exception :

invalid parameter format, : given, : or ? expected.

any ideas?

there space between ':' , parameter name:

->andwhere('a.superior=: superior') 

instead, should be:

->andwhere('a.superior = :superior') 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -