slvler/mysql-connectors
最新稳定版本:v1.2.1
Composer 安装命令:
composer require slvler/mysql-connectors
包简介
Mysql driver development that can be used on the php side
README 文档
README
Mysql driver development that can be used on the php side
Installation
To install this package tou can use composer:
composer require slvler/mysql-connectors
Usage
use slvler\mysqlconnectors\Constant; use slvler\mysqlconnectors\Config\Method; use slvler\mysqlconnectors\Database\DatabaseController; $Constant = new Constant(); $db = new DatabaseController($Constant->showDBHost(), $Constant->showDBName(), $Constant->showDBUser(), $Constant->showDBPassword(), $Constant->showConnection());
Basic Table // use northwind
table "orders"
| OrderID | EmployeeID | ShipName |
|---|---|---|
| 10249 | 6 | red |
| 10250 | 4 | yellow |
| 10251 | 3 | green |
| 10252 | 4 | yellow |
| 10253 | 3 | red |
Insert Method (TableName, Data = array()):
TableName, Data:
$tableName = "Orders"; $data = Array ( "ShipName" => "Blue", "ShipAddress" => "Nottingham", "ShipCity" => "UK" );
Insert Method
$methodInsert = $method->Insert($tableName,$data);
Update Method (TableName, Id = array() , Data = array()):
TableName, Id , Data:
$tableName = "Orders"; $Id = array( "OrderID" => "1" ); $data = Array ( "ShipName" => "Blue", "ShipAddress" => "Nottingham", "ShipCity" => "UK" );
Update Method
$methodUpdate = $method->Update($tableName', $id, $data);
Delete Method (TableName, Id = array()):
TableName, Id:
$tableName = "Orders"; $Id = array( "OrderID" => "1" );
Delete Method
$methodDelete = $method->Delete($tableName,$id);
Select_all Method (TableName):
TableName:
$tableName = "Orders";
Select_all Method
$methodSelectAll = $method->Select_all($tableName);
Select_ch Method (TableName, Data = array()):
TableName, Data:
$tableName = "Orders"; $data = Array ( "ShipName", "ShipAddress", "ShipCity" );
Select_ch Method
$methodSelectCh = $method->Select_ch($tableName,$data);
Select_wh Method (TableName, Data = array(), Conn = array(), If = array()):
TableName, Data, Conn, If:
$tableName = "Orders"; $data = Array ( "EmployeeID" => "4" ); $conn = Array ( "!=" ); $if = Array ( "AND" );
Select_wh Method
$methodSelectWh = $method->Select_wh($tableName, $data, $conn, $if);
Testing
vendor\bin\phpunit
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-01-20