用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3716|回复: 3
收起左侧

[HELP] 请问数据库快捷查询中,怎样用语句写不为空的where语句?

[复制链接]
发表于 2010-4-20 11:32:47 | 显示全部楼层 |阅读模式
我试了好多,$this->db->where('pic !=', '""');, $this->db->where('pic !=', 'NULL');, $this->db->where('pic <>', '""');, $this->db->where('pic is', 'not NULL');~~~~~~

都不行,请问应该怎样找出某一列不为空的项?谢谢!!
发表于 2010-4-20 13:35:53 | 显示全部楼层
$where = "name='Joe' AND status='boss' OR status='active'";
$this->db->where($where);

自己写一个 where 子句。
 楼主| 发表于 2010-4-20 18:32:12 | 显示全部楼层
谢谢,直接$this->db->query了。。。。
发表于 2010-4-20 19:17:34 | 显示全部楼层
可以直接写

$this->db->where('xxxx is not null');

本版积分规则