PHP code example of bingher / db
1. Go to this page and download the library: Download bingher/db library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bingher / db example snippets
return [
// 默认使用的数据库连接配置
'default' => env('DB_DRIVER', 'dm'),
...
// 数据库连接配置信息
'connections' => [
'dm' => [
// ★Builder类
'builder' => \bingher\db\builder\DM::class,
// ★Query类
'query' => \bingher\db\query\DM::class,
// ★数据库类型
'type' => \bingher\db\connector\DM::class,
...
],
]
];
return [
// 默认使用的数据库连接配置
'default' => env('DB_DRIVER', 'gbase'),
...
// 数据库连接配置信息
'connections' => [
'gbase' => [
// ★Builder类
'builder' => bingher\db\builder\GBase::class,
// ★Query类
'query' => bingher\db\query\GBase::class,
// ★数据库类型
'type' => bingher\db\connector\GBase::class,
// ★驱动类型: pdo_gbasedbt,pdo_odbc
'driver' => env('C_DRIVER', 'pdo_odbc'),
...
],
]
];
return [
// 默认使用的数据库连接配置
'default' => env('DB_DRIVER', 'gauss'),
...
// 数据库连接配置信息
'connections' => [
'gauss' => [
// ★Builder类
'builder' => bingher\db\builder\OpenGauss::class,
// ★Query类
'query' => bingher\db\query\OpenGauss::class,
// ★数据库类型
'type' => bingher\db\connector\OpenGauss::class,
...
],
]
];
return [
// 默认使用的数据库连接配置
'default' => env('DB_DRIVER', 'kdb'),
...
// 数据库连接配置信息
'connections' => [
'kdb' => [
// ★Builder类
'builder' => bingher\db\builder\KingBase::class,
// ★Query类
'query' => bingher\db\query\KingBase::class,
// ★数据库类型
'type' => bingher\db\connector\KingBase::class,
...
],
]
];