title: Error handling remove or don't output anything to user
body: <p>I have a small issue with an application that i am developing and would like to see if anyone can help</p>
  
  <p>I am looking to display a custom error message on the screen without anything else being shown.</p>
  
  <p>for example in the below function ApplicationFunction if i remove the ; from the code and execute the code nothing is displayed on the page from Application_Output function as there is a php error. This is what im looking for but for all errors i tell it to.</p>
  
  <p>if i re add the ; into ApplicationFunction and remove my connection details or incorrect the wrong password the page executes from the top to the bottom showing the below to the user</p>
  
  <p>Some Text8014379616Some More Text PHP WARNING - theres no password.</p>
  
  <p>how can i get it to not execute anything on the page at all but a custom error message.</p>
  
  <pre><code>class Application  {
      private $Database_Connection;
  
  function ApplicationFunction() {
      return 233424 * 34334;
  }   
  
  function Application_SQLConnect() {
      global $servername,$username,$password,$database;
          $conn = new mysqli($servername, $username, $password,$database);
              if ($conn-&gt;connect_error) {
                  die($conn-&gt;connect_error);                  
              } else {
                  $this-&gt;Database_Connection = $conn;
              }
          return $this-&gt;Database_Connection;          
  }   
  
  function Application_Output() {
      echo"Some Text";
      echo $this-&gt;ApplicationFunction();
      echo"Some More Text";
      echo $this-&gt;Application_SQLConnect();   
  
  }   
  }
  
  $Application = new Application();
  $Application-&gt;Application_Output(); 
  </code></pre>