I am completely new to Zend framework. I have database created in MySQL. Now I want to use it together with Zend. Completely confused how to start with. I have gone through many tutorials like http://framework.zend.com/manual/en/ but was confusing. Can anybody help me on how I can accomplish, with this step-by-step instructions or any good tutorial?
我是Zend框架的新手。我在MySQL中创建了数据库。现在我想和Zend一起使用它。完全混淆了如何开始。我经历了许多教程,如http://framework.zend.com/manual/en/,但令人困惑。任何人都可以通过这个分步说明或任何好的教程帮助我完成我的工作吗?
1 个解决方案
#1
2
2 Methods to do it:
2方法:
Command Line:
zf configure db-adapter "adapter=PDO_MYSQL&dbname=[your databasename]&host=[your host]&username=[your username]&password=[your password]" -s development
or in your application.ini file :
或者在application.ini文件中:
resources.db.adapter = "PDO_MYSQL"
resources.db.params.dbname = "[your database]"
resources.db.params.host = "[your host]"
resources.db.params.username = "[your username]"
resources.db.params.password = "[your password]"
any questions? Mention in comment :)
任何问题?提及评论:)
EDIT:
Since you are starting with Zend, firstly, welcome to Zend Framework :) Here is the tutorial you can refer for initial development: http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/
由于您是从Zend开始的,首先欢迎使用Zend Framework :)以下是您可以参考初始开发的教程:http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/
If you directly want to know only about integrating database (i.e. Models - business logic) refer to this link:
如果您只想直接了解集成数据库(即模型 - 业务逻辑),请参阅以下链接:
PS: Few things in the above links might be deprecated and MAY not work example, the second link talks about ORM as Doctrine whereas we use Doctrine2 now-a-days.
PS:上面的链接中很少有东西可能会被弃用而且可能不起作用,第二个链接将ORM称为Doctrine,而我们现在使用Doctrine2。
All clear?
#1
2
2 Methods to do it:
2方法:
Command Line:
zf configure db-adapter "adapter=PDO_MYSQL&dbname=[your databasename]&host=[your host]&username=[your username]&password=[your password]" -s development
or in your application.ini file :
或者在application.ini文件中:
resources.db.adapter = "PDO_MYSQL"
resources.db.params.dbname = "[your database]"
resources.db.params.host = "[your host]"
resources.db.params.username = "[your username]"
resources.db.params.password = "[your password]"
any questions? Mention in comment :)
任何问题?提及评论:)
EDIT:
Since you are starting with Zend, firstly, welcome to Zend Framework :) Here is the tutorial you can refer for initial development: http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/
由于您是从Zend开始的,首先欢迎使用Zend Framework :)以下是您可以参考初始开发的教程:http://net.tutsplus.com/tutorials/php/zend-framework-from-scratch/
If you directly want to know only about integrating database (i.e. Models - business logic) refer to this link:
如果您只想直接了解集成数据库(即模型 - 业务逻辑),请参阅以下链接:
PS: Few things in the above links might be deprecated and MAY not work example, the second link talks about ORM as Doctrine whereas we use Doctrine2 now-a-days.
PS:上面的链接中很少有东西可能会被弃用而且可能不起作用,第二个链接将ORM称为Doctrine,而我们现在使用Doctrine2。
All clear?