title: How to use MySQLi in a class
body: <p>I have 2 files</p>
  
  <p>MySQLi.php</p>
  
  <pre><code>$MySQLi = new mysqli($DB_ServerName, $DB_UserName, $DB_Password, $DB_Name); 
      if($MySQLi-&gt;connect_error) 
      { 
          ... 
      } 
      else 
      { 
          ... 
      }  
  </code></pre>
  
  <p>Articles.php</p>
  
  <pre><code>class Articles 
  { 
      public function AddArticle() 
      { 
          if ($MySQLi-&gt;query("INSERT INTO articles (Title, ArticleContent, Author) VALUES ('Title', 'Content', 'Author')") === TRUE) 
          { 
             ... 
          } 
          else 
          { 
              ... 
          } 
      } 
  }
  </code></pre>
  
  <p>How can I use $MySQLi in Articles class?
  ‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎</p>