title: SQL SUM rows in php
body: <p>I currently have this SQL statement that works if there is only one row in the table but if there is more than one it doesn't work.</p>
  
  <pre><code>$mon = mysql_query("SELECT SUM(amount)AS `ingame` FROM `players` WHERE `playername` = '$player'")or die(mysql_error());
  $money = mysql_fetch_assoc($mon);
  $moneyingame = $amount['ingame'];
  </code></pre>
  
  <p>An example of the table</p>
  
  <pre><code>PLAYERNAME AMOUNT
  player1    100
  player1    100
  player2    100
  player3    100
  </code></pre>
  
  <p>so when i run the SQL in the code if player1 it should return 200</p>