MongoDB Tutorial for Beginners - 20 - MongoDB PHP(1/5)

preview_player
Показать описание

📱 Follow Codevolution

Choosing driver for PHP with MongoDB.
This video explains how to download and install the right driver to perform CRUD operations using PHP and Mongodb.

Mongodb |Mongodb Tutorial | Mongodb PHP | PHP Mongodb driver
Рекомендации по теме
Комментарии
Автор

Hi i am getting this error

Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/5.6.28


my php code is:
<?php
$m=new MongoClient();
$db=$m->student;
echo "connected to database student";

romapatel
Автор

Hi I have been trying to connect to mongodb from php. I am using the below dll:


I was going through one of the threads on stackoverflow which mentions that MongoClient() class has been deprecated. Instead of it now we need to use something like this:
$m = new MongoDB\Driver\Manager();

I have the following code:
<?php
$m = new MongoDB\Driver\Manager();
$db = $m->testdb;
echo "Connected to db";
?>

Still I am getting error for class not found. Does anyone have any idea about it? Or do I have to import something? Please help.

amanmaheshwari
Автор

am getting this error:
Fatal error: Class 'MongoClient' not found in C:\Program Files on line 3
I am not getting how to remove the above error
I have written the code same as above and i am using ampps
Any solution for this?

kirtijamor
Автор

Hi, Please Suggest the Code to Upload Image and Retrieve image from Database using PHP

abhishekkamble
Автор

MongoClient is deprecated in recent versions -> throws fatal exception for me. I have to call like this $m = new

radleyanaya
Автор

friend can psarme driver for mongo php?

jersonquintana
Автор

<?php
$m = new MongoClient();
$db = $m->birds;
echo "Connected to database birds";
Output:
Parse error: syntax error, unexpected '$db' (T_VARIABLE) in C:\xampp\htdocs\mongophp.php on line 3

shraddhagami