svn: /phpdoc/en/trunk/reference/mongo/ datatypes.xml mongo.xml

From: Date: Thu, 17 Dec 2009 23:52:23 +0000
Subject: svn: /phpdoc/en/trunk/reference/mongo/ datatypes.xml mongo.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-5678@lists.php.net to get a copy of this message
kristina Thu, 17 Dec 2009 23:52:23 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=292277 Log: fixed code example & ws Changed paths: U phpdoc/en/trunk/reference/mongo/datatypes.xml U phpdoc/en/trunk/reference/mongo/mongo.xml Modified: phpdoc/en/trunk/reference/mongo/datatypes.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/datatypes.xml 2009-12-17 23:29:53 UTC (rev 292276) +++ phpdoc/en/trunk/reference/mongo/datatypes.xml 2009-12-17 23:52:23 UTC (rev 292277) @@ -100,9 +100,9 @@ <![CDATA[ <?php - // $scores will be saved as an array - $scores = array(98, 100, 73, 85); - $collection->insert(array("scores" => $scores); +// $scores will be saved as an array +$scores = array(98, 100, 73, 85); +$collection->insert(array("scores" => $scores); // $scores will be saved as an object $scores = array("quiz1" => 98, "midterm" => 100, "quiz2" => 73, "final" => 85); @@ -128,11 +128,11 @@ returned as associative arrays). The fields are used for the key/value pairs. For example, a blog post might look like: <programlisting role="php"> - <![CDATA[ +<![CDATA[ <?php // the blog post class - class Post { +class Post { var $author; var $content; @@ -140,15 +140,14 @@ var $date; public function __construct($author, $content) { - $this->author = $author; -$this->content = $content; - $this->date = new MongoDate(); - } + $this->author = $author; + $this->content = $content; + $this->date = new MongoDate(); + } - public function setTitle($title) { - $this->title = $title; - } - + public function setTitle($title) { + $this->title = $title; + } } // create a simple blog post and insert it into the database Modified: phpdoc/en/trunk/reference/mongo/mongo.xml =================================================================== --- phpdoc/en/trunk/reference/mongo/mongo.xml 2009-12-17 23:29:53 UTC (rev 292276) +++ phpdoc/en/trunk/reference/mongo/mongo.xml 2009-12-17 23:52:23 UTC (rev 292277) @@ -21,7 +21,7 @@ <?php $m = new Mongo(); // connect -$db = $m->selectDatabase(); // get a database object +$db = $m->selectDB("foo"); // get a database object ?> ]]>

« previous php.doc.cvs (#5678) next »