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

[版本 3.x] CI数据库查询辅助函数

[复制链接]
发表于 2016-3-4 10:00:18 | 显示全部楼层 |阅读模式
select username from ci_user where id = '1'

这个sql语句在CI里有什么查询辅助函数可以简化吗?,我不想写这么长..
发表于 2016-3-4 10:32:23 | 显示全部楼层
$this->select('username')->get_where('ci_user',array('id'=>1));
 楼主| 发表于 2016-3-4 10:51:14 | 显示全部楼层
Aloghli 发表于 2016-3-4 10:32
$this->select('username')->get_where('ci_user',array('id'=>1));

谢谢!  另外你是不是少打了db...        $this->db->select()
发表于 2016-3-4 18:12:10 | 显示全部楼层
霸道的温柔 发表于 2016-3-4 10:51
谢谢!  另外你是不是少打了db...        $this->db->select()

对  少了db

本版积分规则