PDO Class bindParam() not working
<p>I'm trying to edit an INSERT query using bindParam().</p>

<p>Here is my code.</p>

<pre><code>public function addProduct()
{
   $query = "INSTERT INTO producten (name, model, price, image, description) 
   VALUES (:name, :model, :price, :image, :description)";

   $stmt = $this-&gt;dbh-&gt;prepare($query);


   $stmt-&gt;bindParam(":name", $_POST['name']);
   $stmt-&gt;bindParam(":model", $_POST['model']);
   $stmt-&gt;bindParam(":price", $_POST['price']);
   $stmt-&gt;bindParam(":image", $_FILES['file']['name']);
   $stmt-&gt;bindParam(":description", $_POST['description']);

    print_r($stmt);
}
</code></pre>

<p>$dbh object is created in the contruct function of the class;</p>

<pre><code>public function __construct()
    {
       $user = "root";
       $pass = "";

       $this-&gt;dbh = new \PDO('mysql:host=localhost;dbname=projectname', $user, $pass);

    }
</code></pre>

<p>The $stmt->bindParam() returns true when tested but does not replace the given parameters.</p>

<p>Does anyone know what i'm doing wrong?</p>
