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
Post a Comment