0
PHP(Symfony的2.0)時:MySQL查詢例外,在查詢中使用正則表達式
$term = "3";
$query = $em->createQuery(
"SELECT * FROM SoftsystemSupportBundle:Shop WHERE sid REGEXP '^$term'"
);
$shops = $query->getResult();
拋出一個異常:
Error: Expected IdentificationVariable | StateFieldPathExpression | AggregateExpression | \"(\" Subselect \")\" | ScalarExpression, got '*'"
我想其中SID字段匹配正則表達式的所有實體。
任何想法最新怎麼了?
無法幫助您直接回答,但爲何不嘗試使用SQLFiddle? – JvdBerg