我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何使用PHP连接MongoDB 1.1.7版?

Previously I was using mongo 1.4 version in PHP. But now I have upgraded to MongoDB 1.1.7. So, I am using following code to connect with mongoDB.

  $mongo = new MongoClient();

But I am getting following error:

  Class 'MongoClient' not found

Please suggest me to reslove this error.

I'll assume you meant you upgraded from 1.1.7 to 1.4?

According to PHP.net, MongoClient is deprecated in versions past 1.3.0. Use MongoDB\Driver\Manager instead.

http://php.net/manual/en/class.mongoclient.php

近期文章

  • PHP PUT请求
  • AJAX Post为一个函数提供了404错误,但类似的函数运行正常
  • 数据库错误mysqli_init()
  • 错误帖子dropzoneJs
  • Cakephp 2.8.4忽略hasMany
  • 致命错误函数必须是一个字符串
  • 页面没有重定向,PHP
  • Magento导入 - 未定义跳过行sku
  • PostgreSQL在非空值上插入错误
  • 使用MongoDB和PHP更改查询响应数组值
  • 使用PhP连接到HTML的MySQL表[重复]
  • 在jQuery .load()内容之后使用$ _SESSION变量
  • 从php应用程序写入/ etc的最安全的方法?
  • 如何在编辑类var时运行函数
  • 可以用<?替换example.com。 php echo BASE_URL; ?>?
  • php中带有'current'字样的变量名称会添加特殊字符
  • WooCommerce动作 - 钩子名称
  • 不向json文件添加数据
  • 从href标签中解析元素
  • laravel QueryException / SQLSTATE [42S02]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华