<?php
//数据库配置1
'DB_CONFIG1' = array(
'db_type' => 'mysql',
'db_user' => 'root',
'db_pwd' => '',
'db_host' => 'localhost',
'db_port' => '3306',
'db_name' => 'wxuser'
);
//数据库配置2
//'DB_CONFIG2' => 'mysql://root:1234@localhost:3306/thinkphp';
?>
InstallAction.class.php
<?php
// 本类由系统自动生成,仅供测试用途
class InstallAction extends Action {
public function install(){
protected $connection = 'DB_CONFIG1';
//添加数据为闸
DROP TABLE IF EXISTS `wxu_user`;
CREATE TABLE `wxu_user` (
`id` int(10) NOT NULL AUTO_INCREMENT ,
`username` varchar(30) CHARACTER SET gbk COLLATE gbk_chinese_ci NOT NULL ,
`password` int(10) NOT NULL ,
PRIMARY KEY (`id`)
)ENGINE=MyISAM DEFAULT CHARACTER SET=gbk COLLATE=gbk_chinese_ci AUTO_INCREMENT=1;
}
}
运行http://xxxxxxxxxx/index.php/Install/install
Parse error: syntax error, unexpected '=' in E:\APMServ5.2.6\www\htdocs\Conf\config.php on line 4
Fatal error: print_r() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in E:\APMServ5.2.6\www\htdocs\ThinkPHP\Common\common.php on line 594
最佳答案