开发者

using MongoHQ and PHPFog

开发者 https://www.devze.com 2023-03-13 06:02 出处:网络
newbie here. I m confused.I want to know how I could use MongoDB through MongoHQ 开发者_运维百科with an app hosted on PHPFog. Phpfog uses Github to pushcommits in your base folder. Thank you!Use http:

newbie here. I m confused. I want to know how I could use MongoDB through MongoHQ 开发者_运维百科with an app hosted on PHPFog. Phpfog uses Github to push commits in your base folder. Thank you!


Use http://www.php.net/manual/en/class.mongo.php to use MongoDB from PHP.

Log in to MongoHQ and create a database. Get the connection URL, which should be something like this:

mongodb://<user>:<password>@flame.mongohq.com:27101/testing

Then use this line in PHP to connect to the database:

$m = new Mongo("mongodb://<user>:<password>@flame.mongohq.com:27101");

Remember to remove the /testing at the end of the connection URL.


log into your phpfog account select the app you want mongoHQ DB on. Click "add-ons" and select MongoHQ. that simple :)

0

精彩评论

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