常用dll文件插件:php_mongo.dll 5.4,5.5免费下载

作者:jike_studyday

资源类型:
工具/软件
更新:
2015-07-21
运行环境:
其他
来源:
原创
大小:
1.17MB
下载:
62次
标签:

介绍

php_mongo.dll 5.4,5.5插件各个版本下载。

在PHP中安装php_mongo.dll的扩展中,遇到 mongo.dll加载不了:

1.检查了下自己PHP版本为5.2,检查到原因php_mongo.dll与PHP版本不匹配,

2.重新在https://github.com/mongodb/mongo-php-driver/downloads下载了mongo-1.1.4.zip

3.解压mongo-1.1.4.zip\mongo-1.1.4-php5.2vc6ts ,

4.将php_mongo.dll覆盖D:\wamp\bin\php\php5.2.9-1\ext\php_mongo.dll,

5.重启apache,安装OK。

找到代码:

<?php
$mongo_server_name = 'admin';
$mongo_server_pwd  = 'admin';

// 连接Mongo数据库   数据库地址:端口/账号:密码;
$mongo = new Mongo('mongodb://localhost:27017/admin:admin');

// 选择一个数据库和要操作的集(如果没有数据库默认创建)
//$collection = $mongo->selectDB('hf_note')->selectCollection('AccessaLog'); //方法一
$collection = $mongo->selectCollection('hf_note', 'AccessaLog'); //方法二

$dataList = $collection->find();

foreach ($dataList as $key => $val)
{
    var_dump($val);
}

 

 

运行结果:

 
array '_id' =>object(MongoId)[7] public '$id' =>string'4f570e3775b7e117a0b38ef6'(length=24) 'username' =>string'lijunhua'(length=8) 'password' =>string'123456'(length=6) 'sex' =>string'male'(length=4) 'age' =>int27array '_id' =>object(MongoId)[8] public '$id' =>string'4f570f4175b7e117a0b38ef7'(length=24) 'username' =>string'harris'(length=6) 'password' =>string'harris'(length=6) 'sex' =>string'male'(length=4) 'age' =>int28array '_id' =>object(MongoId)[7] public '$id' =>string'4f570f9c75b7e117a0b38ef8'(length=24) 'username' =>string'amdin'(length=5) 'password' =>string'admin'(length=5) 'sex' =>string'male'(length=4) 'age' =>int27

效果图



评论列表