title: SQL update WHERE xx AND most recent record
body: <p>I need to do something that seems to be very simple:</p>
  
  <pre><code>$bdd-&gt;query('UPDATE mytable SET aaa = \''.$aaa.'\', bbb = \''.$bbb.'\' WHERE name = \''.$name.'\'');
  </code></pre>
  
  <p>My problem: I have multiple records that match this "WHERE", and I want to update only the most recent one (I have a date and an id that can be used to define which record is the most recent)</p>
  
  <p>How can I change my WHERE to add something like "<strong>AND id = the_highest_id_of_this_query</strong>"?</p>