Php 按方向排列的顺序无效
在我的数据库中有Php 按方向排列的顺序无效,php,symfony,doctrine-orm,Php,Symfony,Doctrine Orm,在我的数据库中有id、uid和data列,我想按DESC对id进行排序 $this->getDoctrine()->getRepository(FormInputs::class)->findBy(['uid' => $uid], ['id', 'DESC']); 如果使用第二个参数(['id',DESC']),则会出现以下错误: 为App\Entity\FormInputs\0指定的按方向排列的顺序无效 为什么会出现此错误?请尝试像这样传递该错误 $this->
id
、uid
和data
列,我想按DESC
对id
进行排序
$this->getDoctrine()->getRepository(FormInputs::class)->findBy(['uid' => $uid], ['id', 'DESC']);
如果使用第二个参数(['id',DESC']
),则会出现以下错误:
为App\Entity\FormInputs\0指定的按方向排列的顺序无效
为什么会出现此错误?请尝试像这样传递该错误
$this->getDoctrine()->getRepository(FormInputs::class)->
findBy(
array('uid'=>$uid),
array('id'=>'DESC')
);
你看到区别了吗<代码>['id'=>'DESC']@gp\u-sflover哦,是的,现在我明白了!谢谢:)