codeigniter:查询处于非条件状态 [英] codeigniter: where query in not condition

查看:46
本文介绍了codeigniter:查询处于非条件状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果此查询选择id = 11的所有记录

If this query for select all records where id =11

 $this->db->select('title')->from('mytable')->where('id', $id)->limit(10, 20);
 $query = $this->db->get();

然后查询什么来选择 id!= 11 的所有记录

then what is the query to select all records where id != 11 in CodeIgniter style.

推荐答案

只需以 CodeIgniter 样式。

$this->db->select('title')->from('mytable')->where('id !=', $id)->limit(10, 20);
$query = $this->db->get();

顺便说一句,请经常检查codeigniter手册,并在位置正确地提及() 文档,它是您最好的文档之一永远都找不到。

Btw, always check the codeigniter manual, it mentions it right with the where() documentation and it's one of the best documentations you are ever going to find.

这篇关于codeigniter:查询处于非条件状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆