1
查詢我嘗試如果我試試這個創建數組參數
$em->createQuery('select i from AcmePublicBundle:Public i where i.usuario in (9, 10)');
一切都很好執行這個查詢
$em->createQuery('select i from AcmePublicBundle:Public i where i.user in (:opc)');
$query->setParameter('opc', $opc);
where :opc is an array like this
$opc={array}[2]
0 = {array}[1]
id = "9"
1 = {array}[1]
id = "10"
我得到這個錯誤
Notice: Undefined offset: 0 in...
。但我必須通過$opc
。
任何想法?