Order by Length - impressed this worked :-) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: General (https://forum.codeigniter.com/forumdisplay.php?fid=1) +--- Forum: Lounge (https://forum.codeigniter.com/forumdisplay.php?fid=3) +--- Thread: Order by Length - impressed this worked :-) (/showthread.php?tid=66054) |
Order by Length - impressed this worked :-) - PaulD - 08-29-2016 Hi, Was really impressed that this worked: PHP Code: $this->db->order_by('LENGTH(story_text)', 'DESC'); I sat there for ages wondering how I was going to order by length, and I just thought I would try it (it is part of a much longer query so I did not want to write it all out as SQL), and wow, it worked! Just thought I would share that. Paul. |