How can i define a mysql connection in Zend's application.ini file?
I am new to Zend Framewo开发者_StackOverflow中文版rk. I want to initialize connection configration of zend and phpmyadmin. Whats the code for that?
This connection is not between Zend and phpmyadmin. It is Zend-MySQL connection.
Please read following article. It includes basic information that how to connect to MySQL with Zend:
- Create a Model and Database Table
Here is a sample of application.ini database configuration:
[production]
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "mysqlhost"
resources.db.params.username = "mysqlusername"
resources.db.params.password = "mysqlpassword"
resources.db.params.dbname = "databasename"
resources.db.isDefaultTableAdapter = true
resources.db.params.charset = "utf8"
resources.db.adapter = "pdo_mysql"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = ""
resources.db.params.dbname = "mysite"
resources.db.isDefaultTableAdapter = true
;resources.db.params.profiler = true ;if you use profiler
精彩评论