title: PDO Error In SignUp Class
body: <p>I'm working on my own SignUp class but it seems I have a problem with the PDO calls
  The browser returns this to me:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function query() on a non-object</p>
  </blockquote>
  
  <p>I have my database configuration in a file included then on the main page. It's as follows:</p>
  
  <pre><code>   &lt;?
     $dsn = 'mysql:dbname=magazin-online;host=localhost;';
     $username = 'root';
     $password = '';
  
     try{
         $pdo = new PDO($dsn, $username, $password);
     }catch(PDOException $e){
         echo 'Connection failed!: '.$e-&gt;getMessage();
     }
  </code></pre>
  
  <p>An the line in the SignUp class causing the error is this:</p>
  
  <pre><code>   $pdo-&gt;query("insert into ... () ... values ());
  </code></pre>
  
  <p>Now, I don't make any db connection in my SignUp class because I already included the file resposible for it.</p>
  
  <p>How can I get rid of that error?</p>