inphp-db's People
inphp-db's Issues
请问我设置了config文件,怎么去使用他。。我这样写是错误的
<?php
include "./vendor/autoload.php";
use DB\DB;
//您需要定义一个常量:RUNTIME,并给予此文件夹写入权限,默认保存在 RUNTIME."/db/error.txt" 里边
define("RUNTIME", __DIR__."/runtime");
//定义数据库配置文件或配置,填写文件路径(*推荐*)
define("INPHP_DB_CONFIG", __DIR__."/mysql.php");
//数据库连接配置
//$config = [
// //默认一个连接池
// 'default' => [
// 'driver' => 'mysql', //数据库类型
// 'host' => '127.0.0.1', //数据库服务器地址
// 'port' => '3306', //端口
// 'user' => 'root', //账号
// 'pass' => 'root', //密码
// 'database' => 'shop', //数据库名
// 'prefix' => '' //各表的统一前缀
// ]
//];
//初始化 DB 类 (本系统中,引用 use DB\DB;将会自动初始化连接数据库)
DB::init(INPHP_DB_CONFIG);
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.