Download the PHP package koalaphp/database without Composer
On this page you can find all versions of the php package koalaphp/database. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package database
KoalaPHP Database Component
1. 建立数据库连接
只需要在 Bootstrap
阶段初始化一次即可。
2. 获取PDO连接
3. SimpleDao 接口文档(增、删、改、查等)
前提假设条件:
-
user表SQL语句
-
UserModel PHP文件
- UserDao PHP文件
3.1 insert 插入一行记录
insertRow
插入一行数据到数据库的表中
示例代码:
3.2 update 更新记录
-
(1).
updateRow
通过ID(主键)更新特定的一行记录 - (2).
updateMultiRows
通过ID(主键)列表来更新特定的多行记录
示例代码:
3.3 delete 删除一行记录
示例代码:
3.4 select 查询记录
3.4.1 查询方法定义
主要有以下几个查询方法,函数定义如下:
-
(1).
findCount
查询符合条件的某一个对象 -
(2).
findCount
获取该查询条件下的总数 -
(3).
findAllRecordCore
进行查询获取多行记录的方法 - (4).
createGenerator
获取迭代器,可用于循环获取所有行的功能
示例代码:
3.4.2 $conditions
查询where条件语句语法介绍
-
(1). 基本的 AND 语句
-
(2). 某个字段带有不等式的查询
-
(3). 某个字段同时带有大于和小于的范围查询
-
(4). 某个字段带有 IN 范围查询
-
(5). 某个字段带有 LIKE 范围查询
-
(6). 带有某个或者多个字段的 OR 语句 (必须以"single_or_condition"为前缀)
-
(7). 带有某个或者多个字段的 AND 语句 (必须以"single_and_condition"为前缀)
- (8). 带有GROUP BY 语句的聚合查询语句
4. ShardingUserDao
高阶用法,支持查询分库分表Dao文件
示例代码:
All versions of database with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.6.0
The package koalaphp/database contains the following files
Loading the files please wait ....