Codeigniter : Error in ORDER BY CASE query

前端 未结 5 1358
野性不改
野性不改 2021-01-05 12:10

Here is my query in Codeigniter

$this->db->select(\'p.*,u.firstname, u.lastname,s.title AS industry, pt.type_name , al.length_value\',         


        
5条回答
  •  孤街浪徒
    2021-01-05 12:24

    I tested today and it's working.

    You can use it like you said whenever you use the second parameter FALSE to disable escaping.

    $this->db->order_by("CASE p.submit_to
                                        WHEN '' THEN 0
                                        WHEN 'writer' THEN 1
                                        ELSE 2
                                    END, p.request_end_date asc",FALSE);
    

    Greetings.

提交回复
热议问题