<?php

 include("db.php");
 
 $customerBalance_sql="select * from customerbalance";
 $customerBalance_query= $db ->query($customerBalance_sql);
 while($customerBalance_row=$customerBalance_query ->fetch_array()){
 
    $customerId=$customerBalance_row['customerId'];
    $currencyId=$customerBalance_row['currencyId'];
    $amount=$customerBalance_row['amount'];
	$date='1400-01-18';
     
 if($amount!=0){
 echo $insert_customerOpeningBalance_sql="insert into customeropeningbalance (date,customerId,currencyId,amount) values ('$date','$customerId','$currencyId','$amount')";
 echo "<br>";
 $insert_customerOpeningBalance_query= $db ->query($insert_customerOpeningBalance_sql);
 }
 }



?>