1 Star 0 Fork 0

落舞者/php-db-model

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Demo.php 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
落舞者 提交于 2019-05-25 13:10 . fix:调整代码优雅
<?php
include 'Db.php';
$config = [
'master' =>[
'host' => '127.0.0.1',
'dbname' => 'mysql',
'username' => 'root',
'password' => 'dream',
'port' => '3306',
],
'slaves' =>[[
'host' => '127.0.0.1',
'dbname' => 'mysql',
'username' => 'root',
'password' => 'dream',
'port' => '3306',
]],
];
$db = \Core\Db::getInstance($config);
//$data = $db->table('help_topic')->rows('select * from help_topic limit 2;select * from help_topic limit 1;');
//$data = $db->table('help_topic')->single('select * from @table limit 2;',null,null);
//$data = $db->table('help_topic')->rows('select 1; select 2; select 3; select 4;');
//$data = $db->table('help_topic')->limit(1)->get();
//$data = $db->table('help_topic')->where('[#]help_topic_id+1 =1')->get();
//$res = $db->table('help_topic')->where('[#]help_topic_id+1 =1');
$res = $db->table('help_topic')->where('[#]help_topic_id =10');
$data = $res->explain();
$cnt = $res->count('help_topic_id');
print_R($data);
print_R($cnt);
//echo $db->debugDumpParams();
//print_R($data);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/mlboy/php-db-model.git
git@gitee.com:mlboy/php-db-model.git
mlboy
php-db-model
php-db-model
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385