1 回答
TA贡献1824条经验 获得超5个赞
问题是您的代码不执行$sql2and $sql3,您可以使用再次执行它mysqli_query
<?php
include('config.php');
$sql = 'SELECT * FROM inventory_masuk_dummy';
$query = mysqli_query($conn, $sql);
while($row = mysqli_fetch_array($query)) {
$jumlah = $row['jml'];
$size = $row['size'];
$nama_barang = $row['nama_barang'];
$status = $row['status'];
$sql2 = "UPDATE inventory_dummy SET jumlah = jumlah+$jumlah WHERE nama_barang = '$nama_barang' AND size = '$size'";
$sql3 = "UPDATE inventory_masuk_dummy SET status = '2' WHERE status='1'";
if ( mysqli_query($conn, $sql2) && mysqli_query($conn, $sql3) ) {
echo "Berhasil di ubah, anda akan segera dialihkan";
}
}
echo "Nothing...";
- 1 回答
- 0 关注
- 98 浏览
添加回答
举报