title: How to retrieve data after insert with new value in another table
body: <pre><code>&lt;?php include('dbcon.php'); 
  include('header.php');
  
      //variable
      $clientID='';
      $billAmount='';
      $arrear='';
      $monthlyBill='';
      $surcharge='';
  
  
      //data add
  
      $clientID=$_POST['clientID'];
  
  
      $sqll = "SELECT  `client`.`clientId` , (
           `arrear` + `surcharge` + `monthlyBill`) AS  'billamount', (
  
          FROM  `billifno` 
          JOIN  `client` ON  `billifno`.`clientID` =  `client`.`clientID` WHERE  `billifno`.`clientID`='".$_POST["clientID"]."'";
  
  
      $result = mysqli_query($con,$sqll);
  
  //  if ($result-&gt;num_rows &gt; 0) 
  
  
      // output data of each row
      while($row = mysqli_fetch_assoc($result)) {
  
          $clientId = $row['clientId'];
          $arrear = $row['arrear'];
          $monthlyBill= $row['monthlyBill'];
          $billAmount = $row['billAmount'];
          $surcharge = $row['surcharge'];
  
      }   
  
  
          //echo $billAmount;
  
  
  
      $sql = "INSERT INTO `billIfno`
      (`clientID`, `billAmount`,`arrear`,  `monthlyBill`,`surcharge`) VALUES 
      ('$clientID','$billAmount','$arrear','$monthlyBill','$surcharge')";
      if ($con-&gt;query($sql)=== true)
      {
      echo "Recorded!!!";
      }
      else
      {
      echo "Not Recorded !!!";
      }
  
  
      $con-&gt;close();
  ?&gt;
  </code></pre>
  
  <p>Hare I am taking some value and process it using query then again insert into <strong>billInfo</strong> table but it not inserting the new values like
  If I echo <strong>billAmonu</strong> it print the correct value that is calculated by query bt that value is not inserting into database.</p>