<?php
include("db.php");
include("pdate.php");
 $date = pdate("Y/m/d");
 
 $currencyId=$_POST['currencyId'];
 
 if($currencyId==1){
      /* $findeRateSql="select rate from  crrencyrate where baseCurrency='$currencyId' and  date='$date'";
      $findeRateQuery= $db ->query($findeRateSql);
      $findeRateRow=$findeRateQuery ->fetch_array();
      $findeRate=$findeRateRow['rate']; */
      echo"<input type='hidden' id='firstCurrency'  value='1'>";
 
 }
 else{
 $findeRateSql="select rate from  crrencyrate where baseCurrency='1' and counterCurrency='$currencyId' order by id desc limit 1";
 $findeRateQuery= $db ->query($findeRateSql);
 $findeRateRow=$findeRateQuery ->fetch_array();
 $findeRate=$findeRateRow['rate'];
 echo"<input type='hidden' id='firstCurrency'  value=".$findeRate.">";
  }
?>