title: Insert row if not exists otherwise update sqlite - JavaScript
body: <p>I know there have been a lot of questions on this in the past, but I seem to be unable to utilise those answers.  I have tried, but they don't seem to work.</p>
  
  <p>I have a table which stores two user inputted values: name and email.  When they enter their name and e-mail, it gets stored into a single row of my table.</p>
  
  <p>I want to be able to update this same row with a different name and email if the user types some other values, or insert these values if there weren't any previous values.</p>
  
  <p>My code is here:</p>
  
  <pre><code>db.transaction(function(transaction) {
   transaction.executeSql('INSERT INTO Details(name,email)\
   VALUES(?,?)',[$('#entername').val(), $('#enteremail').val()],
   nullHandler,errorHandler);
  
   });
  </code></pre>
  
  <p>and the table creation is here if needed:</p>
  
  <pre><code>db.transaction(function(tx){
     tx.executeSql( 'CREATE TABLE IF NOT EXISTS Details(Id INTEGER NOT\
                     NULL PRIMARY KEY,name,email)',
                     [],nullHandler,errorHandler);
                             },errorHandler,successCallBack);
  </code></pre>
  
  <p>I have tried using INSERT OR REPLACE, but this just creates a new row with new details and leaves the previous row there with the old details.  Are there any efficient options relevant to my case?  Thanks</p>