<?php
 include("db.php");
 
 $takeAmount_sql="select * from customerbalance where currencyId='5'";
 $takeAmount_query= $db ->query($takeAmount_sql);
 while($takeAmount_row=$takeAmount_query ->fetch_array()){


     $customerId=$takeAmount_row['customerId'];
     $currencyId=$takeAmount_row['currencyId'];
     $amount=$takeAmount_row['amount'];

     $currencyId=3;
	 $insert_sql="insert into customeropeningbalance (date,customerId,currencyId,amount) values ('1398-01-27','$customerId','$currencyId','$amount')";
     $insert_query= $db ->query($insert_sql);
   } 



?>