<?php
$sql=mysql_query("SELECT * FROM faturalar where musterino= '$musterino' ORDER BY id ASC");
while($row=mysql_fetch_assoc($sql)){
?>
<tr>
<th><span class="glyphicon glyphicon-chevron-right"></span></th>
<th><?=$row['faturano']?></th>
<th><?=$row['donem']?></th>
<th><?=$row['sonodeme']?></th>
<th><?=$row['geneltoplam']?></th>
<th><? if($row['durumu']=="1")
{
echo "<font color='green'>Ödendi</font>";
} else {
echo "<font color='red'>Ödenmedi</font>"; } ?> <? if($row['durumu']=="0")
{
echo "<a href='fatura-ode.php?faturano=$row[faturano]'>Hemen Öde</a>";
} ?></th>
</tr>
<?php
}
?> while döngüsünde fazla kayıt olayı
3
●338
- 08-08-2014, 16:11:33Üyeliği durdurulduMerhaba arkadaşlar while ile müşterilerimin faturalarını listeliyorum her sayfada 10 kayıt şeklinde göstermek istiyorum nasıl yapabilirim 1 - 2 -3 gibi sayfa numarası vermek istiyorum kullandığım kod:
- 08-08-2014, 16:14:56SELECT * FROM `student` LIMIT 20, 10Binet adlı üyeden alıntı: mesajı görüntüle
şeklinde bir döngü 20'den başlayıp 10 tane gösterecektir. - 08-08-2014, 16:39:23O zaman while dışında bir $i tanımlayıp her seferinde bunu bir arttırabilir ve eğer 10 veya katıysa bunu göstermesini sağlayabilirsiniz.Binet adlı üyeden alıntı: mesajı görüntüle
<?php $i =0; $sql=mysql_query("SELECT * FROM faturalar where musterino= '$musterino' ORDER BY id ASC"); while($row=mysql_fetch_assoc($sql)){ $i++; if(($i%10 == 0) && ($i!=0)) { ?> butonlar <?php } else { ?> <tr> <th><span class="glyphicon glyphicon-chevron-right"></span></th> <th><?=$row['faturano']?></th> <th><?=$row['donem']?></th> <th><?=$row['sonodeme']?></th> <th><?=$row['geneltoplam']?></th> <th><? if($row['durumu']=="1") { echo "<font color='green'>Ödendi</font>"; } else { echo "<font color='red'>Ödenmedi</font>"; } ?> <? if($row['durumu']=="0") { echo "<a href='fatura-ode.php?faturano=$row[faturano]'>Hemen Öde</a>"; } ?></th> </tr> <?php } } ?>