title: PHP mysqli Select Add field
body: <p>I have a table that looks like this:</p>
  
  <pre><code>id | user_id | credits
  ----------------------
  1  | 2       | 300
  2  | 2       | 200
  3  | 4       | 100
  </code></pre>
  
  <p>I need a select or way to add the credits from a specific user id</p>
  
  <p>The select would be:</p>
  
  <pre><code>SELECT credit FROM myTable WHERE user_id ='2'
  </code></pre>
  
  <p>The result I would need in this case would be <strong>500</strong></p>
  
  <p>How can I do this?</p>