Connecting to mongodb using PDO driver

若如初见. 提交于 2019-12-22 01:44:58

问题


Will I be able to connect to this database using php's php_mongo.dll driver?

If so, could you please provide some sample code as I was not able to get it in any forum?


回答1:


MongoDB requires its own driver.

In your case, the PHP driver is located here: http://php.net/manual/en/book.mongo.php

The instructions for installing it are on that page. There is also some sample code.




回答2:


I think that PDO is only for relational databases. There's no PDO driver for mongodb.




回答3:


There is list of databases which you can use with PDO driver: http://php.net/manual/en/pdo.drivers.php MongoDb is not among them.



来源:https://stackoverflow.com/questions/8255440/connecting-to-mongodb-using-pdo-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!