lzyname 发表于 2010-4-20 11:32:47

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

我试了好多,$this->db->where('pic !=', '""');, $this->db->where('pic !=', 'NULL');, $this->db->where('pic <>', '""');, $this->db->where('pic is', 'not NULL');~~~~~~

都不行,请问应该怎样找出某一列不为空的项?谢谢!!

Hex 发表于 2010-4-20 13:35:53

$where = "name='Joe' AND status='boss' OR status='active'";
$this->db->where($where);

自己写一个 where 子句。

lzyname 发表于 2010-4-20 18:32:12

谢谢,直接$this->db->query了。。。。

linde 发表于 2010-4-20 19:17:34

可以直接写

$this->db->where('xxxx is not null');
页: [1]
查看完整版本: 请问数据库快捷查询中,怎样用语句写不为空的where语句?