Php 如何编写MYSQL查询!=在Codeigniter活动记录中?

Php 如何编写MYSQL查询!=在Codeigniter活动记录中?,php,mysql,sql,codeigniter,oracle10g,Php,Mysql,Sql,Codeigniter,Oracle10g,我有以下使用codeigniter活动记录功能的查询表单 select * from user where user_id!=10 我已经尝试了下面的代码 $condition=array( 'userr_id!='=>2, ); $this->db-get('userd',$condition); 其返回数据库错误。如何使用活动记录功能进行查询?试试这个 $this->db->where("your_id !=",$your_id); 试试这个 $this->

我有以下使用codeigniter活动记录功能的查询表单

select * from user where user_id!=10
我已经尝试了下面的代码

$condition=array(
'userr_id!='=>2,
);
$this->db-get('userd',$condition);
其返回数据库错误。如何使用活动记录功能进行查询?

试试这个

$this->db->where("your_id !=",$your_id);
试试这个

$this->db->where("your_id !=",$your_id);
试试这个:

$this->db->where("your_id <> ".$your_id);
$this->db->where(“您的\u id”。$your\u id);
在SQL中指的是NotEqual

试试这个:

$this->db->where("your_id <> ".$your_id);
$condition=array(
                 'user_id !='=>$id
                );
$this->db->get('users',$condition);
$this->db->where(“您的\u id”。$your\u id);
指SQL中的NotEqual

$condition=array(
                 'user_id !='=>$id
                );
$this->db->get('users',$condition);