thinkphp的配置问题

浏览:495 发布日期:2015/09/03 分类:求助交流 关键字: 配置问题
我安装的wampServer的本地端口是81
config.php中我写的代码如下:
<?php
'DB_TYPE' => 'mysql',
'DB_HOST' => 'localhost:81',
'DB_NAME' => 'thinkphptest',//数据库名字
'DB_USER' => 'root', //数据库用户名
'DB_PWD' => '',
'DB_PORT' => '3306',

'DB_PREFIX' => ''
?>
在Action目录下的IndexAction.php中代码如下:
<?php
class IndexAction extends Action {
public function index(){
$m=M('user');
$array = $m ->select();
$this->assign('data',$array);
var_dump($array);
$this->display();
}
}
?>
在index.html页面中测试代码如下:
<body>
<h1>标题</h1>
<table>
<tr><td >id</td><td>标题</td></tr>
<volist name="data" id="vo">
<tr><td >{$vo.id}</td>
<td >{$vo.name}</td>
</tr>
</volist>
</table>

</body>
但是结果使用var_dump测试,返回bool(false),在index页面中无数据返回,已经建立了表user于数据库中
最佳答案
评论( 相关
后面还有条评论,点击查看>>