Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 排序时如何将“0”值设置为结尾_Php_Sql - Fatal编程技术网

Php 排序时如何将“0”值设置为结尾

Php 排序时如何将“0”值设置为结尾,php,sql,Php,Sql,我试图按asc顺序对我的表值进行排序,我使用了下面的代码来得到结果,但得到的结果是0,01,02的形式。。我希望它是01,02。。 我怎么做我用了一些函数连接表 $where_array = array('publications.status =' => 1); $orderby = $this->db->order_by("uv_nirf", "ASC"); $data['universities'] = $this->common_model->pub_seo

我试图按asc顺序对我的表值进行排序,我使用了下面的代码来得到结果,但得到的结果是0,01,02的形式。。我希望它是01,02。。 我怎么做我用了一些函数连接表

$where_array = array('publications.status =' => 1);
$orderby = $this->db->order_by("uv_nirf", "ASC");
$data['universities'] = $this->common_model->pub_seo_join('vm_universities','','uv_id',$where_array,$orderby);

只需将您的订单更改为以下代码

$where_array = array('publications.status =' => 1);
$orderby = $this->db->order_by("uv_nirf = 0,uv_nirf");
$data['universities'] = $this->common_model->pub_seo_join('vm_universities','','uv_id',$where_array,$orderby);

检查此操作是否有效。

根据您的\u字段=0,从您的\u表顺序中选择*您的\u字段;那么我如何在代码点火器中使用它呢..?您可以使用$this->db->query$sql,$sql是您的查询string@JigarShah是的,它也起作用了。。