开发者

How do I connect to a MSSQL database with the Zend Framework?

开发者 https://www.devze.com 2023-01-20 00:58 出处:网络
I\'m trying to connect to a mssql db with the Zend Framework, my application.ini looks like this: resources.db.adap开发者_如何学Pythonter = \"sqlsrv\"

I'm trying to connect to a mssql db with the Zend Framework, my application.ini looks like this:

resources.db.adap开发者_如何学Pythonter = "sqlsrv"

resources.db.params.host = "localhost\SQLExpress"

resources.db.params.username = "*"

resources.db.params.password = "**"

resources.db.params.dbname = "Database"

resources.db.isDefaultTableAdapter = true

Is there anything wrong with the above?

Thanks.


resources.db.adapter = "sqlsrv"
resources.db.host = "localhost\SQLEXPRESS"
resources.db.dbname = "DatabaseName"
resources.db.isDefaultTableAdapter = true 
resources.db.driver_options.ReturnDatesAsStrings = true

No need for Username or Password.

I always use ReturnDatesAsStrings as it is much easier to handle MsSQL in this way.

0

精彩评论

暂无评论...
验证码 换一张
取 消