<?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 :/ ...

Member Avatar for diafol

Easy, search this forum for 'pagination'. There are literally hundreds of threads.

Easy, search this forum for 'pagination'. There are literally hundreds of threads.

Hi ... i know that... there are a lot of result for 'pagination'... but i can not find for 'multi loop'...

Member Avatar for diafol

for what do you need the pagination?

Outer loop or inner loop?

for what do you need the pagination?

Outer loop or inner loop?

i want to paginate all foreach loop at this query...
example...
id parentid
1 0
2 0
3 0
4 1
5 1
6 0
7 0

there are 2 foreach loop in my script... but i can not paginate it... :(

Member Avatar for diafol

TO me 'paginate' means having a set of 'page links' at the foot or at the head of a list of records, similar to google search results. Is that what you're talking about?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.