title: php mysql limit 10 result per loop
body: <p>i have a dropdown where there are three columns and each column contains 10 results from db
  i want to get first 10 result for first column, then get another 10 result for second column and so on.
  following is my code which generate three column but each column has all the result</p>
  
  <pre><code>&lt;div class="mega-menu"&gt;
              &lt;?php
                  $query = mysql_query("select * from product where pid = 0 and status=1") or die(mysql_error());
                  $total_rows = ceil(mysql_num_rows($query)/10);
                  for($i=1; $i&lt;=$total_rows; $i++)
                  {
              ?&gt;
                &lt;div class="col-1"&gt;
                  &lt;ol&gt;
                      &lt;?php
                          $first_result = mysql_query("select * from product where pid = 0 and status=1 limit 10 offset 10") or die(mysql_error());
                          if(mysql_num_rows($first_result) &gt; 0)
                          { 
                              while($first_row = mysql_fetch_array($first_result)) { 
                      ?&gt;
                      &lt;li&gt;&lt;a href="&lt;?=base_url().$first_row['product_slug']?&gt;"&gt;&lt;?=$first_row['product_name']?&gt;&lt;/a&gt;&lt;/li&gt;
                      &lt;?php } }?&gt;
                  &lt;/ol&gt;
                &lt;/div&gt;
                &lt;?php  } ?&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>i know i am doing mistake in first result query</p>