<?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>Wed, 19 Jun 2013 17:14:37 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Zend Developer Zone: Fetching multiple random rows from a database]]></title>
      <guid>http://www.phpdeveloper.org/news/12466</guid>
      <link>http://www.phpdeveloper.org/news/12466</link>
      <description><![CDATA[<p>
On the Zend Developer Zone, a <a href="http://devzone.zend.com/article/4571-Fetching-multiple-random-rows-from-a-database">recently posted tutorial</a> looks at fetching multiple random rows from a database table (in a MySQL database).
</p>
<blockquote>
As a follow up to my earlier article about <a href="http://www.dasprids.de/blog/2008/06/07/fetching-random-rows-of-mysql-efficiently">fetching a single random row from MySQL</a> I will tell you today, how you can fetch multiple random rows from a table without any hassle. Compared to the solution with fetching a single random row, fetching multiple random rows requires some tricks.
</blockquote>
<p>
The tutorial walks you through the creation of some sample tables, making a simple trigger to keep a "random ID" column in a value range of one to the number of rows (gapless) and a bit of PHP code to select some IDs from the table and the SQL to get their information.
</p>
<p>
Be sure to check out <a href="http://devzone.zend.com/article/4571-Fetching-multiple-random-rows-from-a-database#comments">the comments</a> for mentions of the number of table reads and how optimized certain parts of the queries might be.
</p>]]></description>
      <pubDate>Wed, 06 May 2009 11:17:03 -0500</pubDate>
    </item>
  </channel>
</rss>
