title: Group by title sum of data
body: <p>I have two tables like below</p>
  
  <p>table1:<strong>camp</strong></p>
  
  <pre><code>id --- user_id -- title
  1 ----- 101 ----- abc
  2 ----- 107 ----- xyz
  3 ----- 111 ----- xmp
  4 ----- 101 ----- pop
  5 ----- 101 ----- xza
  6 ----- 107 ----- xvc
  </code></pre>
  
  <p>table2:<strong>exp</strong></p>
  
  <pre><code>id --- camp_id ---- view --- check --- cost
  1 ------ 1 -------- 5 ------- 2 ------ 3
  2 ------ 1 -------- 10 ------ 3 ------ 6
  3 ------ 1 -------- 15 ------ 4 ------ 3
  4 ------ 3 -------- 7 ------- 2 ------ 2
  5 ------ 4 -------- 9 ------- 1 ------ 1
  6 ------ 4 -------- 8 ------- 1 ------ 2
  7 ------ 6 -------- 7 ------- 2 ------ 2
  8 ------ 5 -------- 9 ------- 1 ------ 1
  9 ------ 5 -------- 9 ------- 3 ------ 5
  </code></pre>
  
  <p>Say user_id <strong>101</strong> logged. I need the output for him like below. view = total of views by user_id 101 (means camp_id 1) for title abc. same way check is sum of check under each title, cost is sum of cost under each title.</p>
  
  <pre><code>title---view---check---cost
  abc ---- 30 --- 9 ----- 12
  pop ---- 17 --- 2 ----- 3
  xza ---- 18 --- 4 ----- 6
  </code></pre>
  
  <p>my code : </p>
  
  <pre><code>SELECT c.title as t,SUM(e.view) as v,SUM(e.check) as ch,SUM(e.cost) as co 
    FROM camp c,exp e WHERE c.user_id='$log_id' AND e.camp_id=c.id 
    GROUP BY t
  </code></pre>
  
  <p>showing error. If some change then showing all title but view check cost same in every fried.</p>
  
  <p>Please help</p>