Php Codeigniter或#x27;t在服务器上工作

Php Codeigniter或#x27;t在服务器上工作,php,codeigniter,search,activerecord,Php,Codeigniter,Search,Activerecord,我正在尝试搜索我的一个页面。我的问题是: $where = array( 'user_id !=' => $id, 'privacy' => "Public" ); $this->db->select(''); $this->db->from('table'); $this->db->where($where); $this->db->or_where('user_id', $id); $this->db->like('na

我正在尝试搜索我的一个页面。我的问题是:

$where = array( 'user_id !=' => $id, 'privacy' => "Public" );
$this->db->select('');
$this->db->from('table');
$this->db->where($where);
$this->db->or_where('user_id', $id);
$this->db->like('name', $text);
$this->db->or_like('address', $text);
$query = $this->db->get();

它工作正常,但只在我本地的机器上工作正常。当我把它上传到服务器上时,这个查询以随机顺序返回表中的所有数据。我做错了什么?

您的本地和服务器是否运行相同的codeigniter版本?日志中有错误吗?如果您使用order_by('id','asc')函数,它可能会帮助您解决问题