title: Check if update query was successful [PHP, mysqli]
body: <p>I'm working with PHP and mysqli, what the program is doing is that it is asking for a reset code and email address if the email add and reset code are found in the database it sets the password,<em>this part of the function is working</em>, </p>
  
  <p><strong>I need help with this part:</strong> what I need to do is tell the user if the password was set or not so if the update was successful or not. </p>
  
  <p>What I'm working on:</p>
  
  <pre><code>$uinsert =  "UPDATE member SET password = '$password' WHERE emailadd = '$emailadd' AND resetCode = '$resetcode'";
  
      $update = mysqli_query($mysqli, $uinsert) or die(mysqli_error($mysqli));
  
       if(mysqli_affected_rows($update) == 1 ){ //ifnum
          header("location: ../index.php"); // Redirecting To Other Page
      }
      else{
          echo "&lt;script&gt; alert('Incorrect code, try again!');&lt;/script&gt;";
      }
  </code></pre>
  
  <p>Note: $mysqli is my connection string</p>