DB 配置
在使用 DB 相关函数的时候,需要配置数据库相关信息。一般存放在文件中。
新建配置文件 conf.php:
<?php
return array (
"db" => array (
"type" => "pdo_mysql",
"pdo_mysql" => array (
"master" => array (
"host" => "localhost",
"user" => "root",
"password" => "root",
"name" => "test",
"tablepre" => "bbs_",
"charset" => "utf8",
"engine" => "myisam",
),
"slaves" => array (),
),
),
);
?>
include 配置文件:
<?php
$conf = include "./conf.php";
include "./xiunophp/xiunophp.php";
// 下面就可以使用 db_xxx() 系列函数了,具体请参看文档。
db_create(...);
db_update(...);
?>