title: MySQL - PHP Column Sum
body: <p>I have searched all over the internet and have found various "helpful" tips about how to do a column sum with PHP and a MySQL table. The problem is that I can not get ANY of them to work. </p>
  
  <p>Essentially I have a very simple database with 2 users. The table within the database is called users and each entry has a 'Name' and a 'Total Steps'. All I want to do is display the result of the total steps of each user and then a sum of their steps.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  $steps = mysql_query("SELECT SUM(Total_Steps) AS value_sum FROM users");
  $row = mysql_fetch_assoc($steps);
  $sum = $row['value_sum'];
  ?&gt;
  </code></pre>
  
  <p>However, I get this error upon loading the page:</p>
  
  <pre><code>Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /nfs/nfs4/home/msnether/apache/htdocs/st.php
  </code></pre>
  
  <p>Since I don't know PHP or MySQL very well yet, this is quite frustrating and I would appreciate any help.</p>