简体   繁体   English

Codeigniter查询构建器中的ORDER_BY

[英]ORDER_BY in codeigniter query builder

I am trying to order the result based on status column tinyint(4) which is 0 and 1. 我正在尝试根据状态列tinyint(4)将结果排序为0和1。

In this is query: 在此查询:

$query = $this->db->order_by('status','DESC')->get('subjects');

The expected results are status with a of 1 first but the result query is still following the default database rows. 预期结果的状态为a开头为1,但结果查询仍在默认数据库行之后。 How do I make it so that the status column should be descending? 如何使状态列降序?

在此处输入图片说明

My jquery data table is auto sorting a certain column. 我的jQuery的数据表自动排序某一列。 That's why. 这就是为什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM