为什么order_by()在codeigniter中不起作用?

时间:2011-08-13 14:05:55

标签: php codeigniter sql-order-by

为什么order_by中的codeigniter无效?

$this->db->order_by("id", "desc")->query('SELECT @rownum:=@rownum+1 rownum, t.* FROM (SELECT @rownum:=0) r, hotel_submits t');

1 个答案:

答案 0 :(得分:0)

尝试

$query= $this->db->query('SELECT @rownum:=@rownum+1 rownum, t.* FROM (SELECT @rownum:=0) r, hotel_submits t order by id desc');