Home > Backend Development > PHP Tutorial > zendframework的DB连接使用,该怎么处理

zendframework的DB连接使用,该怎么处理

WBOY
Release: 2016-06-13 11:07:12
Original
836 people have browsed it

zendframework的DB连接使用
现在我想实现的是,初次登陆时,就进行DB连接,然后以后再读取数据库的时候就不用再连接了,Zend_Registry是怎么使用的。
求救!!!!谢谢
------解决方案--------------------
class Db
{
public static function conn()
{
$connParams=array("host"=>"localhost",
       "port"=>"3306",
       "username"=>"root",
                               "password"=>"",
                               "dbname"=>"");
             $db=new Zend_Db_Adapter_Pdo_Mysql($connParams);
             return $db;
}
}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template