◆CI里不能使用mysql的ifnull函数吗?◆
$this->db->select("a.id, a.name, (a.count - ifnull(b.baseCount, 0)) as curCount");$this->db->from("t1 a");
$this->db->join("t2 b", "a.id = b.id", "left outer");
return $this->db->get();
这段加上ifnull就会报错,把ifnull去掉就不会报错,请问如何处理?谢谢! $this->db->select(array("a.id", "a.name", "(a.count - ifnull(b.baseCount, 0)) as curCount")); $this->db->select(array("a.id", "a.name", "(a.count - ifnull(b.baseCount, 0)) as curCount"));
visvoy 发表于 2010-4-8 00:44 http://codeigniter.org.cn/forums/images/common/back.gif
好,我试试,谢谢先! 成功了,太感谢楼主了:D
页:
[1]