title: No error: PDO constructor was not called in
body: <p>Good afternoon. I'm starting using the PDO yesterday, and I have some problem with this. I was creating extendet class, which doesn't work and I can't find the bug.</p>
  
  <p>This is code of my helper class, for work witch PDO:</p>
  
  <pre><code>    class EPDO extends PDO {
    /** Some identificator of connection*/
    public $db;
  
    /**
     * Creating new PDO connections
     */     
    public function __construct($dbhost, $dbname, $dbuser = 'root', $dbpass = '', $dbtype = 'mysql') {
      $db = new PDO($dbtype . ':host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass);
    } 
  
    /**
     * Insert into database with using transaction (if operation failed the changes go before)
     */     
    public function insert($statement) {
      $db-&gt;beginTransaction();
  
      $status = $db-&gt;exec($statement);
      if ($status) {
        $db-&gt;commit();  
      } else {
        $db-&gt;rollback();
      }
    } 
  }
  </code></pre>
  
  <p>And this is the unfunctional code:</p>
  
  <pre><code>$stm = $db-&gt;prepare('SELECT id FROM `startups` WHERE id = :id');
  $params = array(':id' =&gt; $child-&gt;id);
  $ok = $stm-&gt;execute($params);
  $row = $stm-&gt;fetch(PDO::FETCH_ASSOC);
  </code></pre>
  
  <p>Before this code I of course call the connections following way:</p>
  
  <pre><code>  require_once 'EPDO.php';
  
    try {
      $db = new EPDO('--server--', '--database--', '--user--', '--pass--');
    }
    catch (PDOException $err) {
      echo "Chyba spojeni: " . $err-&gt;getMessage();
    }
  </code></pre>
  
  <p>Thank you very much, and sorry for my english.</p>