PHP MySQLi Prepaired Statement's returns false : <p>I'm having a problem with a prepaired statement system though a system of Classes that managed our DB Table Entries.</p>

<p>So the problem i'm having is that the generated SQL of </p>

<pre><code>INSERT INTO `sys_User` SET `email` = ? `last_name` = ? `password` = ? `encryption` = ?
</code></pre>

<p>on the line below <code>$stmt = $db-&gt;prepare($sql);</code> is failing (returning false)</p>

<p>However i'm not getting an error back from the Database engine,</p>

<pre><code>Array
(
    [Number] =&gt; 256
    [String] =&gt; MySQLi Query failed MySQL said ''.
    [File] =&gt; /var/www/models/table/base.php
    [Line] =&gt; 282
)
</code></pre>

<p>Inside a base class for all Database Table Classes.</p>

<pre><code>$db = self::getDatabase();
$bindParamArgs = array();
$bindParamArgs[] = "";
$sql = "INSERT INTO `".$this-&gt;getTableName()."` SET ";
foreach($this-&gt;updated as $name =&gt; $val){
    $sql .= " `".$name."` = ?";
    $bindParamArgs[0] .= $columns[$name]-&gt;Type;
    $bindParamArgs[] = &amp;$this-&gt;values[$name]; 
}
echo $sql;
$stmt = $db-&gt;prepare($sql);
if(!$stmt){
    \trigger_error("MySQLi Query failed MySQL said '".$stmt-&gt;error."'.", \E_USER_ERROR);
}
$result = \site\model\Database::getEvaluatedBind($stmt, $bindParamArgs);
</code></pre>

<p>Some Needed Info:
<code>self::getDatabase();</code> Returns the connection the the Database (MySQLi) object</p>

<p><code>$this-&gt;getTableName()</code> get the table name for the table we're working in this is worked out from the class name that has been called</p>

<p><code>$this-&gt;updated</code> an array of all columns in the Table equal to boolean true if it has been modified and needs to be saved.</p>

<p><code>\site\model\Database::getEvaluatedBind(mysqli_stmt &amp;$stmt, $params)</code> a custom method i created of calling bind_param that keeps the damn pass by refference system happy, </p>

<p>This must be something so simple i'm missing i just can't work it out</p>
