Sql de verileri bulunan siparişleri html table olarak yazdırmaya çalışıyorum.
Fakat for ya da while döngüsü kuramadığım için sadece 1 adet table oluşuyor.
Nasıl bir döngü kurmalıyım ?
Kodlarım aşağıda, yardımlarınız için şimdiden teşekkürler.
<?php
$Bilgiler = mysql_query("SELECT * FROM `cb_order` WHERE `order_status_id` = 19;") or die(mysql_error());;
$Satir = mysql_fetch_assoc($Bilgiler);
$adsoyad = $Satir['firstname'];
$adres = $Satir['payment_address_1'];
$ilce = $Satir['payment_city'];
$il = $Satir['payment_zone'];
$telefon = $Satir['telephone'];
$total = $Satir['total'];
$tutar = explode(".", $total);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/HTML; charset=ISO-8859-9" />
</head>
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg .tg-wcfl{font-family:Arial, Helvetica, sans-serif !important;;background-color:#fcfcfc;color:#000000; text-align: center;}
.tg .tg-4o8c{font-weight:bold;font-size:13px;font-family:Arial, Helvetica, sans-serif !important;;background-color:#d8d8d8;color:#000000;text-align:center}
</style>
<table class="tg" style="table-layout: fixed; width: 300px">
<colgroup>
<col style="width: 110px">
<col style="width: 220px">
</colgroup>
<tr>
<th class="tg-4o8c">İSİM SOYİSİM</th>
<th class="tg-wcfl"><?php echo $adsoyad; ?></th>
</tr>
<tr>
<td class="tg-4o8c">ADRES</td>
<td class="tg-wcfl"><?php echo $adres; ?></td>
</tr>
<tr>
<td class="tg-4o8c">İLÇE / SEMT</td>
<td class="tg-wcfl"><?php echo $ilce; ?></td>
</tr>
<tr>
<td class="tg-4o8c">İL</td>
<td class="tg-wcfl"><?php echo $il; ?></td>
</tr>
<tr>
<td class="tg-4o8c">TELEFON</td>
<td class="tg-wcfl"><?php echo $telefon; ?></td>
</tr>
</table>--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 08:47:39 -->-> Daha önceki mesaj 06:56:40 --
Biraz üzerinde uğraşınca yaptım.
Aynı araştıran arkadaşlar için çalışır halini paylaşıyorum.
$Bilgiler = mysql_query("SELECT * FROM `cb_order` WHERE `order_status_id` = 18;") or die(mysql_error());;
while ($Satir=mysql_fetch_assoc($Bilgiler) )
{
$total = $Satir['total'];
$tutar = explode(".", $total);
}
echo '<table class="tg" style="table-layout: fixed; width: 300px">
<colgroup>
<col style="width: 100px">
<col style="width: 385px">
</colgroup>' ;
echo '<tr>
<th class="tg-4o8c">İSİM SOYİSİM</th>
<th class="tg-wcfl"> '.$Satir['firstname'].' </th>
</tr>
<tr>
<td class="tg-4o8c" style="height:50px;">ADRES</td>
<td class="tg-wcfl" style="height:50px;"> '.$Satir['payment_address_1'].' </td>
</tr>
<tr>
<td class="tg-4o8c">İLÇE / SEMT</td>
<td class="tg-wcfl"> '.$Satir['payment_city'].' </td>
</tr>
<tr>
<td class="tg-4o8c">İL</td>
<td class="tg-wcfl"> '.$Satir['payment_zone'].' </td>
</tr>
<tr>
<td class="tg-4o8c">TELEFON</td>
<td class="tg-wcfl"> '.$Satir['telephone'].' </td>
</tr>
<tr>
<td class="tg-4o8c">TUTAR</td>
<td class="tg-wcfl">'.$tutar[0].' <font> TL</font></td>
</tr>
<tr>
';
echo '</table> ';
}