title: Wordpress update mysql table
body: <p>I am writing a plugin for Wordpress, which should check if a mysql entry already exists.<br>
  If it does not exist Wordpress should insert the entry into the table. This part works as I expected.<br>
  However, if there already is an entry in the mysql table, Wordpress should update the table, but this does not work.</p>
  
  <p>The code I am using for this is the following code:</p>
  
  <pre><code>$wpdb-&gt;query($wpdb-&gt;prepare("UPDATE $table_name SET time=$current_timestamp WHERE userid=$userid"));
  </code></pre>
  
  <p>The variables I use in this query are correct, because they are successfully used to insert into the table, but somewhere along the way something goes wrong with the updating function.</p>
  
  <p>Can somebody please tell me what I am doing wrong here?<br>
  What is the right way to go about this?</p>