title: Stop code after if statement from executing when error occurs
body: <p>This is what my code looks like:</p>
  
  <pre><code>if($allthevaluesarenotempty) {
      if($pictureexist) {
          // upload picture code
      }
      else
      {
          $message = "error";
      }
  
      // sql query here
  }
  </code></pre>
  
  <p>How can I stop the SQL query from executing when <code>$message</code> is set?</p>