Php Veri Çekme Yardımcı Olurmusunuz aceba ? .
<?php $aracliste = mysql_query("select * FROM projeekle where altmenu='stokekle'ORDER BY id DESC ");
while ($araclistele = mysql_fetch_array($aracliste)) {
$id = $araclistele['id'];
$urunfoto = $araclistele['urunfoto'];
$barkodno = $araclistele['barkodno'];
$urunadi = $araclistele['urunadi'];
$alisfiyati = $araclistele['alisfiyati'];
$stokadedi = $araclistele['stokadedi'];
$sql=mysql_query("select * from projeekle where ikat=$id"); while($row=mysql_fetch_array($sql)) { $satismiktari=$row['satismiktari']; $toplam=$satismiktari+$toplam;
$sqll=mysql_query("select * from projeekle where ikat=$id"); while($roww=mysql_fetch_array($sqll)) { $stokadedi=$roww['stokadedi']; $toplamm=$stokadedi+$toplamm;
}}
echo "
<tr> <td class='center'><img src='../yuklemeler/resim/$urunfoto' width='50px' height='50px' ></td>
<td class='center'>$barkodno</td>
<td class='center'>$urunadi</td>
<td class='center'>$alisfiyati TL</td>
<td class='center'>$toplamm</td>
<td class='center'>$toplam</td>
<td class='center' align='center' > <a class='btn btn-' href='stokgir.php?id=$id'> <i class='icon-plus icon-red'></i> Detay </a> <a class='btn btn-success' href='stokgir.php?id=$id'> <i class='icon-plus icon-white'></i> Stok Ekle </a>
<a class='btn btn-info' href='stokduzenle.php?id=$id'> <i class='icon-edit icon-white'></i> Düzenle </a>
<a class='btn btn-danger' href='stoksilonay.php?id=$id'> <i class='icon-trash icon-white'></i> Sil </a> </td>
</tr> ";
}
bu döngüyü yaptığımda her hücreye aynı veriyi çekiyor yani ikat'ı 104 olan veriyi çekiyor hepsine aceba sorun nerede
Php
bu sorguları bilerek mi iki kere yazdın ?
$sql=mysql_query("select * from projeekle where ikat=$id"); while($row=mysql_fetch_array($sql)) { $satismiktari=$row['satismiktari']; $toplam=$satismiktari+$toplam;
$sqll=mysql_query("select * from projeekle where ikat=$id"); while($roww=mysql_fetch_array($sqll)) { $stokadedi=$roww['stokadedi']; $toplamm=$stokadedi+$toplamm;
ayrıca yapmak istediğin işlemi anlamadım onu söyleyebilirsen alternatif başka bir yapı önerebilirim bu yaptığın sorgulama 10 kayıt için sorun çıakarmasa bile ileride patlayacaktır