[英]How to write MYSQL query != in Codeigniter Active records?
I have the below query form using codeigniter active record function, 我有以下使用codeigniter活动记录功能的查询表,
select * from user where user_id!=10
I have tried the below code 我已经尝试了以下代码
$condition=array(
'userr_id!='=>2,
);
$this->db-get('userd',$condition);
its return database error. 其返回数据库错误。 How to make query using active record function? 如何使用活动记录功能进行查询?
试试这个
$this->db->where("your_id !=",$your_id);
$condition=array(
'user_id !='=>$id
);
$this->db->get('users',$condition);
or 要么
$this->db->where("user_id !=",$id);
Try this: 尝试这个:
$this->db->where("your_id <> ".$your_id);
<>
refers to NotEqual in SQL. <>
是指SQL中的NotEqual 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.