avryhof/database
Composer 安装命令:
composer require avryhof/database
包简介
Database Abstraction Layer
关键字:
README 文档
README
A Simple Database abstraction layer.
Normalization
This library is designed mostly to normailze the usage of the included databases.
Object Oriented
Enables some non object-oriented databse functions to be accessed and used in an object-oriented way.
K.I.S.S.
This layer is designed so you don't need to learn a whole new way of working with databases. It is designed to work as closely to the built-in PHP functionality as possible, while making it possible to port your application from any of the supported databses to another without changing a bunch of code.
Example
require_once("database.php"); $db = new Database("mysql://user:pass@localhost/database"); or $db = new Database("sqlite:///home/user/data/users.db?mode=0666"); /* The Code Below works the same on all supported databases! */ $db->insert("users", array("name" => "User", "password" => "{password}", "email" => "someone@example.com")); $users = $db->query("SELECT * FROM users WHERE name = 'User'"); if ($users->num_rows > 0) { while($user = $users->fetch_assoc()) { echo "<pre>" . print_r($user,true) . "</pre>"; } } $db->update("users", array("name" => "Bob"),"name = 'User'"); $db->delete("users", "name = 'Bob'");
统计信息
- 总下载量: 178
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-30