title: Use of included class in another class
body: <p>I'm trying to use a database class (ADOdb for PHP) but I don't know how to use it in another class.
  Example:</p>
  
  <pre><code>&lt;?php
  include_once("adodb.inc.php");
  $conn = NewADOConnection('mysql');
  
  class Contacts {
      public function getData(){
          $conn-&gt;Connect(...);
          //do something
      }
  }
  ?&gt;
  </code></pre>
  
  <p>I think the problem is that I can not call $conn because its defined outside the class.</p>
  
  <p><strong>Notice: Undefined variable: conn</strong></p>
  
  <p><strong>Fatal error: Call to a member function Connect() on a non-object</strong></p>
  
  <p>Maybe I'm doing it the wrong way, but I really don't know how to fix this.  </p>
  
  <p>Can somebody please help me out? Thanks a lot!</p>