<?php
require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include ('includes/function.php');

$zdb = $_SESSION["zdbyear_$dbname"];
mysqli_select_db($conn, $zdb);

$result = mysqli_query($conn, "SELECT type,code FROM `product` order by code") or die(mysqli_error($conn));
$getnum = mysqli_num_rows($result);
browse($getnum);
while ($get = mysqli_fetch_array($result)) {
    $code = $get['code'];
    $type = $get['type'];

    mysqli_query($conn, "Update `transacn` set prodtype='$type' where `itemcode`='$code'") or die(mysqli_error($conn));
}
browse("Success");
?>