Erreur : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
<p>when i try to execute an update statement i got the following error :</p>

<pre><code>Erreur : SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Issy-les-Moulineaux ' where ssiphone_idstation=46' at line 1
</code></pre>

<p>my update statement is :</p>

<pre><code>$bdd-&gt;exec("update ssiphone_stationdeservice set $cle='$element' where ssiphone_idstation=$id");
</code></pre>

<p>this is in a php code, THX in advance for your help :)</p>

<p>$cle and $element are in array, my code is :</p>

<pre><code> foreach($table1 as $cle =&gt; $element)
   {
   $bdd-&gt;exec("update ssiphone_stationdeservice set $cle='$element' where ssiphone_idstation=$id");
   }
</code></pre>

<p>now table1 is an array which contain the columns name of my table and its values :</p>

<pre><code>$table1=array();
   $table1['ssiphone_etatstation']=$etat;
   $table1['ssiphone_commerce']=$commerce;
   $table1['ssiphone_stationdelavage']=$lavage;
   $table1['ssiphone_typescarburants']=$lescarburants;
   $table1['ssiphone_joursdelasemaine']=$jourssemaines;
   $table1['ssiphone_horaires ']=$this-&gt;horaires;
   $table1['ssiphone_telephone ']=$telephone;
   $table1['ssiphone_sensdecirculation ']=$this-&gt;sensDeCirculation;
   $table1['ssiphone_adresse ']=$this-&gt;adresse;
   $table1['ssiphone_ville']=$this-&gt;ville;
   $table1['ssiphone_departement']=$this-&gt;departement;
   $table1['ssiphone_nomstation ']=$this-&gt;nomStation;
</code></pre>
