title: MySQL procedure to create or update a row in a table
body: <p>I want to write a MySQL proc which takes <code>userId</code> and <code>userName</code> and does an insert or update into table <code>users</code> dependent on if a row exists where <code>users.userId = userId</code></p>
  
  <p>I saw a similar question here: <a href="https://stackoverflow.com/questions/10253379/mysql-create-or-update-row-with-ip">MySql create or update row with ip?</a></p>
  
  <p>But I want to do this in a stored procedure and wondered if that gives any additional tools?</p>