PHP code example of donng / aliyun-analytic-db
1. Go to this page and download the library: Download donng/aliyun-analytic-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/ */
donng / aliyun-analytic-db example snippets
use AnalyticDB;
// 插入记录(无绑定)
$result = AnalyticDB::withoutPrepare()->insert($sql);
// 插入记录(预编译,绑定数据)
$result = AnalyticDB::insert($sql, $bindingArr);
// 获得所有记录
$result = AnalyticDB::select($sql)->get();
// 获得第一条记录
$result = AnalyticDB::select($sql)->first();
// 不记录sql获取数据(可在配置文件中配置record => false 全部禁用记录sql)
$result = AnalyticDB::select($sql)->disableRecord()->get();
bash
php artisan vendor:publish --provider="Donng\AnalyticDB\Providers\AnalyticDBProvider"
bash
php artisan migrate