<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Fri, 24 May 2013 16:27:56 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Derick Rethans' Blog: MongoDB Cursors with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17990</guid>
      <link>http://www.phpdeveloper.org/news/17990</link>
      <description><![CDATA[<p>
<i>Derick Rethans</i> has a new post to his site today about <a href="http://derickrethans.nl/cursors-in-mongodb.html">MongoDB cursors</a> in PHP when using the <a href="http://php.net/mongodb">PHP driver</a> and how it handles pulling data from the server.
</p>
<blockquote>
Recently I was asked to improve the <a href="http://docs.php.net/manual/en/mongocursor.batchsize.php">MongoCursor::batchSize</a> documentation. This began an indepth investigation in how the PHP <a href="http://php.net/mongodb">driver</a> for <a href="http://mongodb.org/">MongoDB</a> handles pulling data that's been queried from the MongoDB server. Here are my findings.
</blockquote>
<p>
He talks about the cursor that's created when a "find" call is made and how you can add on additional options (via other methods on the cursor) to its execution. He also covers how you can set your own batch size, using limit to only fetch a certain number of results and combining the two to make for more memory efficient, yet complete, returned data sets.
</p>]]></description>
      <pubDate>Tue, 22 May 2012 12:23:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: MongoDB Revisited]]></title>
      <guid>http://www.phpdeveloper.org/news/17407</guid>
      <link>http://www.phpdeveloper.org/news/17407</link>
      <description><![CDATA[<p>
In <a href="http://phpmaster.com/mongodb-revisited/">this new post</a> to PHPMaster.com today <i>Ahmed Shreef</i> continues on from his <a href="http://phpmaster.com/introduction-to-mongodb/">previous introduction to MongoDB</a> and gets into more detail on things like cursors, query operators, queries on embedded documents and the sort/skip methods.
</p>
<blockquote>
In my previous article Introduction to MongoDB I discussed installing Mongo, its PHP extension, and how to perform simple insert and find operations. Of course there are many, many more features than what I mentioned so I wanted to write another article to show you some of them. </blockquote>
<p>
Other topics mentioned include queries on arrays of data and running queries with indexes to improve their performance. Code is also included for each example.
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 12:44:07 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Paging Data with the SQL Server Drivers for PHP: Simplified]]></title>
      <guid>http://www.phpdeveloper.org/news/15820</guid>
      <link>http://www.phpdeveloper.org/news/15820</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has <a href="http://blogs.msdn.com/b/brian_swan/archive/2011/01/26/paging-data-with-the-sql-server-drivers-for-php-simplified.aspx">simplified the pagination</a> using the SQL Server drivers for PHP in his latest post. He shows how to use a cursor to move around in the result set from your query.
</p>
<blockquote>
An oversimplified definition of a database cursor might be this: A cursor is database functionality that allows you to point to a certain location within a result set and allows you to move forward (and sometimes backward, depending upon the cursor type) through the result set one row at a time. [...] In the paging [scenario], I'll use a static cursor since that cursor type would seem to satisfy the requirements of many web-based applications.
</blockquote>
<p>
He shows how to execute a simple query with a dynamic cursor by specifying it in the connection call. He then uses the <a href="http://php.net/sqlsrv_num_rows">sqlsrv_num_rows</a> to find the number of records returned and a <a href="http://php.net/sqlsrv_fetch_array">sqlsrv_fetch_array</a> call to pull just the page you need. He also includes some handy code to paginate the results, complete with links.
</p>]]></description>
      <pubDate>Thu, 27 Jan 2011 12:54:56 -0600</pubDate>
    </item>
  </channel>
</rss>
