pfinal / database
PHP MySQL database wrapper, extends PDO and PDOStatement
v1.12.4
2020-05-11 08:08 UTC
Requires
- php: >=5.4
Requires (Dev)
- phpunit/phpunit: ^5.0
- symfony/var-dumper: *
- dev-master
- v1.12.4
- v1.12.3
- v1.12.2
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.11
- v1.9.10
- v1.9.9
- v1.9.8
- v1.9.7
- v1.9.6
- v1.9.5
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.9
- v1.8.8
- v1.8.7
- v1.8.6
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.4.6
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
This package is auto-updated.
Last update: 2024-11-11 17:23:33 UTC
README
数据库操作类
PHP交流 QQ 群:16455997
环境要求:PHP >= 5.3
使用 composer
composer require "pfinal/database"
<?php require __DIR__ . '/../vendor/autoload.php'; $config = array( 'dsn' => 'mysql:host=localhost;dbname=test', 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'tablePrefix' => 'db_', ); $db = new \PFinal\Database\Builder($config); $id = $db->table('user')->insertGetId(['username' => 'Jack', 'email' => 'jack@gmail.com']); echo $id;
如果你的项目未使用Composer,请使用下面的方式做类自动加载
<?php include "./database/src/ClassLoader.php"; $loader = new \PFinal\Database\ClassLoader(); $loader->register();