title: mysql sum() is not working. How can I solve it?
body: <p>I am using php 7.2...</p>
  
  <p>The code is working fine</p>
  
  <pre><code>&lt;?php 
  
      $add=mysqli_query($conn,'SELECT ac_id, SUM(amount)  from stac where ac_id="117" '); 
      while($row1=mysqli_fetch_array($add)) { $mark=$row1['SUM(amount)'];  
      echo $mark ; }?&gt;
  </code></pre>
  
  <p>but the code below is not working. Please help me.</p>
  
  <pre><code>&lt;?php 
    $ac_id=$_POST['ac_id'];
  
  
      $add=mysqli_query($conn,'SELECT ac_id, SUM(amount)  from stac where ac_id=$ac_id '); 
      while($row1=mysqli_fetch_array($add)) { $mark=$row1['SUM(amount)'];  
      echo $mark ; }?&gt;
  </code></pre>