<?php //error_reporting(0); require 'view/header.php'; include 'config.php'; ?> <form action="" method="post"> <h4>Insert a regex command below</h4> <!--Regex: <input type="text" name="regex"/>--> Title: <input type="text" name="title"/> <input type="submit" value="Search"/><br/><br/> </form> <?php $m = new MongoClient(); $db = $m->selectDB("fldev"); $collections = $db->getCollectionNames(); $collection = $m->selectCollection('fldev', 'docs'); //var_dump($collection); echo "<pre>"; foreach ($collections as $collectionName) { echo "Found collection: ", $collectionName, "<br/>"; } echo "</pre><br/>"; ?> <?php //$regex=(isset($_POST["regex"]) ? $_POST["regex"] : ""); $title=(isset($_POST["title"]) ? $_POST["title"] : ""); //var_dump($regex); //$results = $collection->findOne(array('title' => 'greeklish abstract')); echo "<pre>"; var_dump($collection->findOne(array('$title' => 'greeklish abstract'))); var_dump($collection->findOne(array('$id' => '526937f8fa96470e3944a7ef'))); echo "</pre>"; ?> <?php require 'view/footer.php'; ?>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)