 <ul> <li>This $dbh is unset so it becomes $this->null->beginTransaction().</li> <li>beginTransaction() returns a bool so $stmt becomes bool not PDOStatement</li> </ul> <p>-</p> <pre><code>$stmt=$this-&gt;$dbh-&gt;beginTransaction(); </code></pre> <p>Should probably be something like</p> <pre><code>$this-&gt;dbh-&gt;beginTransaction(); $sql = ... $stmt = $this-&gt;dbh-&gt;prepare($sql); </code></pre> <p>Replace ... with your insert query.</p> <ul> <li>You don't need transactions for just one query.</li> </ul>