标签:style class blog code get 使用
在Bootstrap中使用
$url = constant ( "APPLICATION_PATH" ) . DIRECTORY_SEPARATOR . 'configs' . DIRECTORY_SEPARATOR . 'application.ini'; $dbconfig = new Zend_Config_Ini ( $url, "mysql" ); // $db = Zend_Db::factory ( $dbconfig->db ); $db = Zend_Db_Table::getDefaultAdapter (); // var_dump ( $db ); $db->query ( "set names utf8" ); // Zend_Db_Table::setDefaultAdapter ( $db );会出现$db不能实例化的情况,其中Application.ini文件的内容如下:
[mysql] resources.db.adatper=PDO_MYSQL resources.db.isDefaultTableAdapter = true resources.db.params.host=localhost resources.db.params.username=root resources.db.params.password=admin resources.db.params.dbname=hsp
$db = Zend_Db::factory ( 'PDO_MYSQL', array ( 'host' => 'localhost', 'username' => 'root', 'password' => 'admin', 'dbname' => 'hsp' ) ); $db->query ( "set names utf8" ); Zend_Db_Table::setDefaultAdapter ( $db );
Zend_Db_Table::getDefaultAdapter is not working,布布扣,bubuko.com
Zend_Db_Table::getDefaultAdapter is not working
标签:style class blog code get 使用
原文地址:http://blog.csdn.net/shijiebei2009/article/details/32949095