acabala
acabala

Reputation: 149

Can't read mongodb data with PHP

I've just started my adventure with mongodb and found some problems, I can't get by with:

when I create new collection with PHP and put some example data here, it saves, so I have possibility to show it in mongo console (however PHP execution still works, and is not going to stop(?) ), but when I want to get my data back by PHP there (doesn't matter if the same sript or the other one), it starts to execute, execute and execute with no visual result.

Do you maybe have any idea, why something like that happens? Config: xampp (php5.3) @ windows + php_mongo.dll

Upvotes: 0

Views: 350

Answers (1)

Tom Gruner
Tom Gruner

Reputation: 9635

Check to make sure the mongodb server is running properly as well in the services, sounds like it may not be started. Are you testing to make sure your collection is really being saved?

Make sure you check for the last error even when you try to save the collection and insert data to see where your error is actually happening

http://php.net/manual/en/mongodb.lasterror.php

Upvotes: 1

Related Questions