phpcms v9 数据库操作函数
2014-04-05 11:52
330 查看
表明默认当前load_model('xxxx')模块所在表名xxxx
若要指定表名 则:操作在mysql.class.php中$this->db->select(...)
1、查询
$this->select($where = '', $data = '*', $limit = '', $order = '', $group = '', $key='') 返回结果集数组
条件,字段(id,name,email....),范围 排序方式,分组方式,按建名排序
2、查询多条数据并分页
listinfo($where = '', $order = '', $page = 1, $pagesize = 20, $key='', $setpages = 10,$urlrule = '',$array = array())
3、获取单条记录查询
get_one($where = '', $data = '*', $order = '', $group = '')
4、直接执行sql查询
query($sql);
5、获取最后一次添加记录的主键号 insert_id()
6、执行更新记录操作 update($data, $where = '') $data 建议为数组,$where 可为数组可为字符串
7、执行删除记录操作 delete($where)
8、计算记录数 count($where = '')
9、获取最后数据库操作影响到的条数 affected_rows()
10、获取数据表主键 get_primary()
11、获取表字段 get_fields($table_name = '')
12、检查表是否存在 table_exists($table)
13、 检查字段是否存在 field_exists($field)
若要指定表名 则:操作在mysql.class.php中$this->db->select(...)
1、查询
$this->select($where = '', $data = '*', $limit = '', $order = '', $group = '', $key='') 返回结果集数组
条件,字段(id,name,email....),范围 排序方式,分组方式,按建名排序
2、查询多条数据并分页
listinfo($where = '', $order = '', $page = 1, $pagesize = 20, $key='', $setpages = 10,$urlrule = '',$array = array())
3、获取单条记录查询
get_one($where = '', $data = '*', $order = '', $group = '')
4、直接执行sql查询
query($sql);
5、获取最后一次添加记录的主键号 insert_id()
6、执行更新记录操作 update($data, $where = '') $data 建议为数组,$where 可为数组可为字符串
7、执行删除记录操作 delete($where)
8、计算记录数 count($where = '')
9、获取最后数据库操作影响到的条数 affected_rows()
10、获取数据表主键 get_primary()
11、获取表字段 get_fields($table_name = '')
12、检查表是否存在 table_exists($table)
13、 检查字段是否存在 field_exists($field)
相关文章推荐
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- phpcms v9 数据库操作函数
- cakephp中操作数据库的函数总结
- powershell数据库操作函数
- hibernate操作数据库的存储过程或函数
- 数据库及表、列的操作,常用函数
- 程序媛:数据库操作之封装为函数(sqlite3 )
- tinkphp3.2数据库操作一(函数部分)
- Mysql多线程、多用户同时操作数据库获取当前用户操作的最新主键值(mysql_insert_id() 函数返回上一步 INSERT 操作产生的 ID)
- Oracle学习笔记20150823java程操作数据库与部分常见函数的使用
- PHP 下与几个常用数据库的操作函数