title: PHP mysqli increase value
body: <p>I need to say that I'm a beginner on php, mysqli, but I want to learn.
  I am trying to build an quiz script which store &quot;SCORE&quot; information into database.</p>
  <p>I have the following &quot;final.php&quot; page script, which collects and inserts into the database, the current score of user.
  What I need is that I want to keep the current score from database &quot;eg: 213&quot;, and increase with current session score which will be &quot;eg :10&quot;, so total score after that will be &quot;213(old) + 10(current) = 223(total)</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
  $servername = "localhost";
  $username = "";
  $password = "";
  $dbname = "";
  
  // Create connection
  $conn = new mysqli($servername, $username, $password, $dbname);
  // Check connection
  if ($conn-&gt;connect_error) {
      die("Connection failed: " . $conn-&gt;connect_error);
  } 
  
  $sql = "UPDATE users SET scor='".$_SESSION['score']."' WHERE id=2";
  
  if ($conn-&gt;query($sql) === TRUE) {
      echo "Record updated successfully";
  } else {
      echo "Error updating record: " . $conn-&gt;error;
  }
  
  $conn-&gt;close();
  ?&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Everything working fine with that code, but all what I need is that to increase score.
  Thank you to everyone for you patience and because you understand me that I am beginner.</p>