You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
646 B
PHP

<?php
include "./db_login.inc.php";
include "./func_lib.php";
$mysqli_dbeli = new mysqli(HOST, USER, PASSWORD, DATABASE);
$qry_select = $mysqli_dbeli->query("SELECT id,harga_pokok FROM `no_barang` ORDER BY id");
if($qry_select->num_rows > 0){
while($pembelian = $qry_select->fetch_array(MYSQLI_ASSOC)){
$id = $pembelian['id'];
$harga_pokok = $pembelian['harga_pokok'];
$harga_pokok_new = convHrgP($harga_pokok);
$Insert_to_dbeli = $mysqli_dbeli->prepare("UPDATE no_barang SET harga_pokok = '$harga_pokok_new' where id = '$id'");
$Insert_to_dbeli->execute();
echo $harga_pokok." ".$harga_pokok_new."<br/>";
}
}
?>