where clause with order_by in codeigniter giving me issue |
Hi All,
I am new in codeigniter framework, I have to add order_by in my query.. PHP Code: $data['work']=$this->work->where('wuFk', session()->get('uId'))->get()->getResult(); I want to add the order_by('uName','DESC'), added like below but giving me issue, bad method execptions. PHP Code: $data['work']=$this->work->where('wuFk', session()->get('uId'))->order_by('uName','DESC')->get()->getResult(); $data['work']=$this->work->where('wuFk', session()->get('uId'))->get()->getResult();
Showing the exact error message would make you get better support.
Assuming you are using CI4 and a model, issue may be here ->getResult() you should either use getResultArray() if you expect an array or getResultObject() if you expect an object
Web developer creating tools for streamers
Countdown Tools: https://obscountdown.com
Online Polls https://streampollmaster.com
(03-27-2024, 12:11 AM)prem16 Wrote: Hi All, Hey hi, use orderBy() instead of order_by() $data['work']=$this->work->where('wuFk', session()->get('uId'))->order_by('uName','DESC')->get()->getResult(); |
Welcome Guest, Not a member yet? Register Sign In |