sql - createQueryBuilder and setParameter with multiple parameters? -
i've been trying create sql query , keep on having error 2nd parameter.
maybe missing here.
here request :
$pointstef = $this->getdoctrine()->getmanager(); $pointstefs = $pointstef->createquerybuilder('t') ->select('t.points') ->from('appbundle:tef', 't') ->where('t.epreuve = :epreuve') ->setparameter('epreuve',$valeur) ->andwhere('t.resultat = :resultat') ->setparameter('resultat',$valeurepreuve) ->getquery() ->getresult();
is proper way of using setparameter(); ?
an exception occurred while executing 'select t0_.points points_0 tef t0_ t0_.epreuve = ? , t0_.resultat = ?' params ["ce", "b1"]:
sqlstate[hy093]: invalid parameter number: columns/parameters 1-based
do this
->setparameters(array('param1'=> $param1, 'param2' => $param2))
Comments
Post a Comment