title: Can I use ON DUPLICATE KEY UPDATE with an INSERT query using the SET option?
body: <p>I've seen the following (using the VALUES option):</p>
  
  <pre><code>$query = "INSERT INTO $table (column-1, column-2, column-3) VALUES ('value-1', 'value-2', 'value-3') ON DUPLICATE KEY UPDATE SET column1 = value1, column2 = value2, column3 = value3, ID=LAST_INSERT_ID(ID)"; 
  </code></pre>
  
  <p>... but I can't figure how to add ON DUPLICATE KEY UPDATE to what I'm using:</p>
  
  <pre><code>$query = "INSERT INTO $table SET
      column-1 ='value-1',
      column-2 ='value-2',
      column-3 ='value-3'
  ";
  </code></pre>
  
  <p>e.g.:, pseudo-code</p>
  
  <pre><code>$query = "INSERT INTO $table SET
      column-1 ='value-1',
      column-2 ='value-2',
      column-3 ='value-3'
      ON DUPLICATE KEY UPDATE SET
      column1 = value1,
      column2 = value2,
      column3 = value3,
      $id=LAST_INSERT_ID(id)"; 
      $my_id = mysql_insert_id();
  ";
  </code></pre>
  
  <p>I would find the latter easier to read. Would appreciate clarification, didn't find an example in the manual.</p>
  
  <p>cheers</p>