title: MODX REVO + php mysql - insert data to specified table row
body: <p>I'm trying to add some data to a custom-db-table like this:</p>
  
  <pre><code>$sql ="insert into ext_user_data (userdata_id,vorname,nachname) values('$id','$vorname','$nachname')";
  $stmt = $modx-&gt;prepare($sql);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>This works fine, expect by using this code I'm getting a new row in the table ext_user_data. I want to add this data to an existing row like this:</p>
  
  <pre><code>$sql ="insert into ext_user_data where id='136'(userdata_id,vorname,nachname) values('$id','$vorname','$nachname')";
  $stmt = $modx-&gt;prepare($sql);
  $stmt-&gt;execute();
  </code></pre>
  
  <p>But by using this code nothing gets added to the db-table.</p>
  
  <p>So how can I add something to this custom-db-table to a given primary key? The primary key is the same as the $id.</p>