title: PHP Calculation from database not calculating correctly.
body: <p>I am trying to run a sum from numbers taken from a database. However i can't seem to get it to work. </p>
  
  <p>Does anyone have any ideas as to why i keep getting 0 instead of a percentage? if so could you guide me in the right direction.  </p>
  
  <p>PHP:</p>
  
  <pre><code>//SQL Original Goal
  $goal = "SELECT * FROM login WHERE username = '$login'";
  $goalquery = mysql_query($goal);
  $goalarray = mysql_fetch_array($goalquery); 
  $endgoal = $goalarray['goal'];
  
      //Latest Weight
  $latestweightarray = mysql_fetch_array($latestweightq);
  $currentweight = $latestweightarray['weight'];
  
      //First Weight Recorded
  $firstweightarray = mysql_fetch_array($firstweightq);
  $firstweight = $firstweightarray['weight'];
  
  $percent = "100";
  
  $progress = (($firstweight - $currentweight) / ($firstweight - $endgoal)) * $percent;
  </code></pre>
  
  <p>Print Result: </p>
  
  <pre><code>&lt;?php 
  echo $progress 
  ?&gt;
  </code></pre>
  
  <p>This just gives: 0</p>