liberty_code/mysql
最新稳定版本:v1.0.0
Composer 安装命令:
composer require liberty_code/mysql
包简介
Library
README 文档
README
Description
Library contains MySQL components, to use SQL components for MySQL data storage.
Requirement
- Script language: PHP: version 7 || 8
Installation
Several ways are possible:
Composer
Requirement
It requires composer installation. For more information: https://getcomposer.org
Command: Move in project root path
cd "<project_root_path>"Command: Installation
php composer.phar require liberty_code/mysql ["<version>"]Note
Include vendor
If project uses composer, vendor must be included:
require_once('<project_root_path>/vendor/autoload.php');Configuration
Installation command allows to add, on composer file "/composer.json", following configuration:
{ "require": { "liberty_code/mysql": "<version>" } }
Include
Download
- Download following repository.
- Put it on repository root path.
Include source
require_once('<repository_root_path>/include/Include.php');
Usage
MySQL database connection
Connection allows to design MySQL database connection, to connect and request on specific MySQL data storage, from specified configuration.
Elements
MysqlPdoConnection
Extends PDO connection features, Allows to design a MySQL database connection, using specific PDO standard.
Example
use liberty_code\sql\database\connection\library\ConstConnection;
use liberty_code\mysql\database\connection\pdo\model\MysqlPdoConnection;
...
// Get connection
$connection = new MysqlPdoConnection(array(
ConstConnection::TAB_CONFIG_KEY_HOST => 'host',
ConstConnection::TAB_CONFIG_KEY_DB_NAME => 'db_name'
ConstConnection::TAB_CONFIG_KEY_CHARSET => 'utf8',
ConstConnection::TAB_CONFIG_KEY_LOGIN => 'login',
ConstConnection::TAB_CONFIG_KEY_PASSWORD => 'password'
));
...
// Execute SQL command
$connection->execute('...SQL string command');
...
统计信息
- 总下载量: 600
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-12-01