<?php $datax = $db->get_results("SELECT
katid,
katparentid,
katadi,
katsira,
katdurum
FROM sql_kategori WHERE katparentid='0'");?>
<form action="index.php?menu=com.kategori:ekle.kod" method="post" name="formx" id="formx">
<table id="tablexcaption" width="600" border="0" cellspacing="2" cellpadding="2">
<tr id="caption">
<td width="40" align="center" valign="middle">Id</td>
<td width="40" align="center" valign="middle">P.Id</td>
<td>Kategori Adı</td>
<td width="40" align="center" valign="middle">Durum</td>
<td width="40" align="center" valign="middle">Sıra</td>
<td width="40" align="center" valign="middle">Düzenle</td>
<td width="40" align="center" valign="middle">Seç</td>
</tr>
</table>
<table id="tablexcontent" width="600" border="0" cellspacing="2" cellpadding="2">
<?php foreach($datax as $data) { ?>
<tr id="content">
<td width="40" align="center" valign="middle"><?php echo $data->katid;?></td>
<td width="40" align="center" valign="middle"><?php echo $data->katparentid;?></td>
<td><?php echo $data->katadi;?></td>
<td width="40" align="center" valign="middle"><?php echo $data->katdurum;?></td>
<td width="40" align="center" valign="middle"><?php echo $data->katsira;?></td>
<td width="40" align="center" valign="middle">Düzenle</td>
<td width="40" align="center" valign="middle">Seç</td>
</tr>
<?php $datax2 = $db->get_results("SELECT
katid,
katparentid,
katadi,
katsira,
katdurum
FROM sql_kategori WHERE katparentid='$data->katid'");?>
<?php foreach($datax2 as $data2) {?>
<tr id="content" style="background-color:#CC9;">
<td width="40" align="center" valign="middle">+</td>
<td width="40" align="center" valign="middle"><?php echo $data2->katparentid;?></td>
<td><?php echo $data2->katadi;?></td>
<td width="40" align="center" valign="middle"><?php echo $data2->katdurum;?></td>
<td width="40" align="center" valign="middle"><?php echo $data2->katsira;?></td>
<td width="40" align="center" valign="middle">Düzenle</td>
<td width="40" align="center" valign="middle">Seç</td>
</tr>
<?php } ?>
<?php } ?>
</table>
</form>
how can i paginate this multi loop :/ ...