CI框架数据库相关函数

返回查询影响的记录数

$res = $this->db->get_where(‘wx_life’,array(‘id’=>$id));
$num = $res->num_rows();

获取刚刚插入到数据库中的记录的id

$this->db->insert_id()

显示数据库操作所影响的行数

$this->db->affected_rows()
当执行写入操作(insert,update等)的查询后,显示被影响的行数。(对delete操作同样有效)

Git .gitignore部分忽略失效

在程序中添加了.gitignore 文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/Demo/Demo-Info.plist
.DS_Store
/build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
profile
*.moved-aside
DerivedData
.idea/
*.hmap

Read More