
是入口,最好不要改名字。
新版本的
Zend
Framework
的入口文件
index.php,已经不这样写了。
如果用最新版,以上代码全都可以废了。
application.ini里这么配置数据库[mysql]
db.adapter='PDO_MYSQL'
db.config.host='localhost'
db.config.username='root'
db.config.password=''
db.config.dbname=''
//初始化数据库适配器
$url = constant("APPLICATION_PATH") . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'application.ini'
$config=new Zend_Config_Ini($url,null, true)
$dbAdapter=Zend_Db::factory($config->mysql->db->adapter, $config->mysql->db->config->toArray())
$dbAdapter->query('SET NAMES UTF8')
Zend_Db_Table::setDefaultAdapter($dbAdapter)
Zend_Registry::set('dbAdapter',$dbAdapter)
既然取到数据说明不是 *** 作数据库上面出现问题,那么就有可能是显示数据 *** 作上除了问题。也就是mvc在c->v中出现了问题。
估计是你的phtml页面没有写<?php foreach ...>这些输出代码
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)