title: mysql SUM not giving correct value
body: <p>I have a SUM query that isnt returning the correct value.
  It returns 1, not the value</p>
  
  <p>There are 2 entries in the table both have the <code>amount</code> column value 200
  so the SUM should return 400 .. not 1</p>
  
  <p>My query is below</p>
  
  <p>Thanks</p>
  
  <pre><code>$owtbdq = mysqli_query($con,"SELECT * FROM `crm`.`workshop-otherwork` WHERE `wsjid` = '$wsjid'");
          $owtbdr = mysqli_fetch_assoc($owtbdq);
          $owtbdc = mysqli_query($con,"SELECT SUM(amount) FROM `crm`.`workshop-otherwork` WHERE `wsjid` = '$wsjid'");
          $owtbdcount = mysqli_fetch_assoc($owtbdc);
  </code></pre>
  
  <p>I have also tried it without the ` around amount and same result</p>
  
  <p>I have just ran </p>
  
  <pre><code> SELECT SUM(amount) FROM `crm`.`workshop-otherwork` WHERE `wsjid` = '4'
  </code></pre>
  
  <p>in HeidiSQL and it correctly returned 400 so havent a clue</p>