Skip to content

Tag: mongodb

Mongodb php datetime filter not working properly

I use mongo db with php I need a last 1 hour data. I implement as like bellow. PHP CODE I need a count result. thanks in advance Answer I am not so familiar with PHP, but I think $client->$db_name is equal to $client->selectDatabase($db_name) However -> does not work with variables, so $client->$d…

php mongodb validate form password

This is my first time using mongodb with php and I have a register and a login form . When a user registers I succesfully hash his password using password_hash() php function and insert it in a …

MongoDB Authentication Required?

I just started looking into MongoDB for some projects I’m working on. Reviewing the documentation I came across some PHP snippets that show how to connect and query and so on. One thing I’ve been having trouble finding is Authentication use case. A lot of the information I’ve found the uses …

Fail install mongodb on Centos 7 with Package error

I try to install mongodb to Centos 7 server with PHP. I follow the install guide from https://www.php.net/manual/en/mongodb.installation.pecl.php But sudo pecl install mongodb show error message: As the error message recommded, I install php-devel package by But I got a lot of Dependency error: Below are the …