title: Pass adodb connection to new php object
body: <p>I'm trying to pass through an adodb connection to a class constructor but in doing so get this error:</p>
  
  <pre><code>mysql_error(): supplied argument is not a valid MySQL-Link resource
  </code></pre>
  
  <p>So to put it into context,  I have instantiated a new adodb connection like this:</p>
  
  <pre><code>// establish database connection
  $db = ADONewConnection($dsn);
  if (!$db) die(mysql_error());
  </code></pre>
  
  <p>Then created my new user access object and passed in the adodb connection like this:</p>
  
  <pre><code>$user = new UserAccess($db);
  </code></pre>
  
  <p>This is the constructor from the user access class:</p>
  
  <pre><code>function UserAccess($oDbLink) {
     // check we have a valid connection
  }
  </code></pre>
  
  <p>Any ideas what I'm doing wrong?</p>
  
  <p>Thanks,
  Gaz</p>