$this->db->get_where() 查询结果 问题
$this->db->get_where() 查询 成功 和 失败 怎么取返回值?看看是否返回 true or false Hex 发表于 2013-5-30 10:25 static/image/common/back.gif
看看是否返回 true or false
他返回 TURE 和 FALSE吗?
$chk = $this->db->get_where() ?'ok' : 'no';那这么写 可以了? L.e.e. 发表于 2013-5-30 10:29 static/image/common/back.gif
他返回 TURE 和 FALSE吗?
$chk = $this->db->get_where() ?'ok' : 'no';那这么写 可以了? ...
可能没有返回值 你要自己测试下,文档没有明确说明。
这里是 CI 不明确的地方。 Hex 发表于 2013-5-30 13:11 static/image/common/back.gif
可能没有返回值 你要自己测试下,文档没有明确说明。
这里是 CI 不明确的地方。 ...
呵呵 知道了~但还是 谢谢你哈 $this->db->affected_rows() 用这个查询返回条数
但是delete语句不能用 $data['files'] = $this->db->get_where('files', array('owner =' => '$owner'))->result();
if(count($data['files']) > 0)
{
do.....
} Raphael 发表于 2013-6-19 11:57 static/image/common/back.gif
$data['files'] = $this->db->get_where('files', array('owner =' => '$owner'))->result();
if(count($da ...
哦哦 学到了~哈 谢谢
也可以这样
eg:
$query = $this->db->get_where('user',array('mobile'=>$username),1,2);
$row1 = $query->row();
eg:
$query = $this->db->get_where('user',array('mobile'=>$username),1,2);
$row1 = $query->result->array();
晨风_NS8UZ 发表于 2015-6-6 18:32
也可以这样
eg:
$query = $this->db->get_where('user',array('mobile'=>$username),1,2 ...
$query = $this->db->get_where('user',array('mobile'=>$username),1,2 ...
$row = $query->row_array();
页:
[1]