[英]Warning in mysqli_fetch_array()
why my array get error because mysqli_fecth
array?为什么我的数组因为mysqli_fecth
数组而mysqli_fecth
? what I can do to the code to make is true because I'm a beginner of this.我可以对代码做的事情是真实的,因为我是这个的初学者。 I change my code to mysqli_fetch_assoc() but the error is the same.我将代码更改为 mysqli_fetch_assoc() 但错误是相同的。
this is the code that i make:这是我制作的代码:
<?php
$query = mysqli_query($con,"SELECT t.po_nomor, p.nama_supplier, p1.nama_barang , t.total FROM
(SELECT t1.po_nomor, (SUM(t1.jumlah)-SUM(COALESCE(t4.terima,0))over(PARTITION by t4.refrence) ) as total
FROM pengiriman_supply t1
INNER JOIN data_supplier t2 ON t1.idsupplier = t2.id_supplier
INNER JOIN data_barang t3 ON t1.idbarang = t3.idbarang
LEFT JOIN masuk t4 ON t4.refrence = t1.po_nomor
where t1.tanggal BETWEEN date_sub(curdate(), interval 120 day) AND curdate()
group by t1.po_nomor,t4.po_nomor) t
INNER JOIN pengiriman_supply s ON s.po_nomor = t.po_nomor
INNER JOIN data_supplier p ON s.idsupplier = p.id_supplier
INNER JOIN data_barang p1 ON s.idbarang = p1.idbarang
GROUP BY t.po_nomor
ORDER by t.po_nomor DESC;");
$no = 0;
while($data = mysqli_fetch_array($query)){
$no++;
?>
<tr>
<td><?= $no ?></td>
<td><?= $data['po_nomor'] ?></td>
<td><?= $data['nama_supplier'] ?></td>
<td><?= $data['nama_barang'] ?></td>
<td><?= $data['total'] ?></td>
</tr>
<?php
}
?> </tbody>
where I can change my code.我可以在哪里更改我的代码。
You try to paste this in ur sql command, if it is not working, then there something wrong inside here.您尝试将其粘贴到您的 sql 命令中,如果它不起作用,则说明这里有问题。
SELECT t.po_nomor, p.nama_supplier, p1.nama_barang , t.total FROM
(SELECT t1.po_nomor, (SUM(t1.jumlah)-SUM(COALESCE(t4.terima,0))over(PARTITION by t4.refrence) ) as total
FROM pengiriman_supply t1
INNER JOIN data_supplier t2 ON t1.idsupplier = t2.id_supplier
INNER JOIN data_barang t3 ON t1.idbarang = t3.idbarang
LEFT JOIN masuk t4 ON t4.refrence = t1.po_nomor
where t1.tanggal BETWEEN date_sub(curdate(), interval 120 day) AND curdate()
group by t1.po_nomor,t4.po_nomor) t
INNER JOIN pengiriman_supply s ON s.po_nomor = t.po_nomor
INNER JOIN data_supplier p ON s.idsupplier = p.id_supplier
INNER JOIN data_barang p1 ON s.idbarang = p1.idbarang
GROUP BY t.po_nomor
ORDER by t.po_nomor DESC;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.