title: PHP adding to sessions
body: <p>I am making an online quiz, in this quiz, one question is asked at a time. If the answer is correct, I want to add that point, to the total score earned. I want the $_SESSION to show how many points the user has earned so far. The code I have so far is this:</p>
  
  <pre><code>$sql = "SELECT * FROM quiz_questions WHERE Question='$question' AND Answer='$answer'";
  $result = mysql_query($sql);
  $num_rows = mysql_num_rows($result);
  if ($num_rows != 0){
  
      $score++;
      $total_score += $score;
      session_start();
      $_SESSION['score'] = $total_score;
  
  } else {
      echo "Incorrect";
  }
    }
  </code></pre>
  
  <p>I already have $score equal to 0 to start in the beginning of the code. Thank you in advance for all your help!</p>