zendframework的DB联接使用
zendframework的DB连接使用
现在我想实现的是,初次登陆时,就进行DB连接,然后以后再读取数据库的时候就不用再连接了,Zend_Registry是怎么使用的。
求救!!!!谢谢
------解决方案--------------------
查查zend framework手册
参考资料
http://blog.csdn.net/cfchengfei002/article/details/7354153
------解决方案--------------------
- PHP code
config.ini [general] db.adapter=PDO_MYSQL db.config.host=localhost db.config.username=root db.config.password=123456 db.config.dbname=test $config=new Zend_Config_Ini('./application/config/config.ini',null, true); Zend_Registry::set('config',$config); $db=Zend_Db::factory($config->general->db->adapter,$config->general->db->config->toArray()); $db->query('SET NAMES UTF8'); Zend_Db_Table::setDefaultAdapter($db); Zend_Registry::set('db',$db); <br><font color="#e78608">------解决方案--------------------</font><br>你想用Zend_Registry实现这个是不行的。因为这个只在一次请求内有效,你要实现登录 保存数据之类的 老实用session吧 <div class="clear"> </div>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Oracle and DB2 are two well-known relational database management systems (RDBMS) that are widely used in enterprise applications. In this article, we will compare the two database technologies of Oracle and DB2 and analyze them in detail, including analysis of their characteristics, performance, functions and usage examples. 1. Overview of Oracle database technology Oracle is a relational database management system developed by Oracle Corporation of the United States. It is widely used in enterprise-level applications and has strong performance and stability.

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

While installing a new version of an application, Windows may display this error message "An error occurred while parsing C:\\Windows\Microsoft.Net\Framework\v2.0.50727\Config\machine.configParser returned error 0xC00CE556". This problem also occurs when your system boots. No matter what situation you encounter this problem, .NETFramework is the real culprit behind the scenes. There are some very simple fixes you can use to stop this error code from appearing again. Fix 1 – Replace corrupted files You can easily replace corrupted ma from the original directory

Oracle and DB2 databases are two leading relational database management systems that are widely used in enterprise-level applications. In practical applications, database performance is often one of the important indicators for evaluating the quality of a database system. This article will conduct a comparative analysis of the performance of Oracle and DB2 databases, and use specific code examples to demonstrate the differences between them. 1. Oracle database performance analysis Oracle database is a powerful database management system with good scalability and stability.

db is the abbreviation of "datebase", which is a format of "database file". It is a file used by software to store data, which is equivalent to a database. Each software has its own storage format. For example, "Thumbs.db" under Win7 system is a thumbnail data file, so the db file is not a specific file format.

1. Press and hold the [Win+R] shortcut key combination on the keyboard, open the [Run] dialogue command window, enter the [services.msc] command, and click [OK];. 2. After opening the service interface, find the [RemoteRegistry] option, and double-click with the left button to open its properties dialog window. 3. In the [RemoteRegistry Properties] dialog window that opens, select the [Disabled] option in the startup type option, and then click the [Apply]--[Stop]--[OK] button to save the settings.

With the continuous development of the PHP language, ThinkPHP, which is widely used in the PHP back-end framework, is also constantly improving. As business scenarios become increasingly complex, the demand for configuration management in ThinkPHP is also increasing. In this context, ThinkPHP provides rich configuration management functions. Today we will introduce how to implement configuration management through ThinkPHPConfig. 1. Introduction to ThinkPHPConfig ThinkPHPConfig is Thin

db is a database file format, which is a file used by software to store data. It is equivalent to a database. Each software has its own storage format, that is, the way the data is arranged; the suffix of some software data files is DB. For example, Thumbs.db under Win7 system is a thumbnail data file; therefore, the db file is not a specific file format.
