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
<div class="mega-menu">
<?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<=$total_rows; $i++)
{
?>
<div class="col-1">
<ol>
<?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) > 0)
{
while($first_row = mysql_fetch_array($first_result)) {
?>
<li><a href="<?=base_url().$first_row['product_slug']?>"><?=$first_row['product_name']?></a></li>
<?php } }?>
</ol>
</div>
<?php } ?>
</div>
i know i am doing mistake in first result query