I want to collect two different tablodas from different values. This process takes too long because the number of records is too large How can I speed up the query?
Table 1 :sf_uretim10
Table 2 :sf_urun10
<?php
$query = $db->get_results("SELECT uretimid,urunadi,uretimharid,urunid,cariid,paketsayisi,boy,tonaj,pakettipi,uretimtipi,uretimyeri FROM sf_uretim10 WHERE (durumu='Siparis' OR durumu='URETIMDE') AND cariid > 4 AND sil !=2 ORDER BY urunadi ASC");
?>
<table id="example">
<thead>
<tr>
<th>Name</th>
<th>Total A</th>
<th>Total B</th>
<th>Total C</th>
</tr>
</thead>
<tbody>
<?php
foreach ($query as $row ){
$total_a = $db->get_var("SELECT SUM(tonaj) FROM sf_urun10 WHERE urunid='$row->urunid' AND tonaj='$tonaj' AND boy='$row->boy' AND (durumu='GIRIS' OR durumu='HATALI') AND cariid < 4 AND sil !=2");
$total_b = $db->get_var("SELECT SUM(tonaj) FROM sf_urun10 WHERE uretimharid='$row->uretimharid' AND cariid='$row->cariid' AND (durumu='GIRIS' OR durumu='HATALI') AND sil !=2 ");
$total_b = $db->get_var("SELECT SUM(tonaj) FROM sf_urun10 WHERE uretimharid='$row->uretimharid' AND cariid='$row->cariid' AND (durumu='CIKIS') AND sil !=2 ");
?>
<tr>
<td><?php echo $row->urunadi; ?></td>
<td><?php echo $total_a; ?></td>
<td><?php echo $total_b; ?></td>
<td><?php echo $total_c; ?></td>
</tr>
<?php } ?>
</tbody>
Thank You
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I have articles table in my DB:
So, let’s say I have 10 rows in my databaseHowever, after the mysql query, only 9 rows are being displayed in the html table
i want to show count result for every my table based on real time date