title: Unable to Update MySQL (AWS RDS) table from Lambda though i am able to connect and INSERT
body: <p>Below is my lambda function. A request is coming from <code>API</code> (<code>API Gateway</code>). Even when I tried to pass the values directly to <strong>update table</strong>, its not updating.
  I am able to <code>INSERT</code> data into the same table through <code>API</code>. Just wondering what's wrong here. </p>
  
  <p>Appreciate any help. Thanks in advance.</p>
  
  <hr>
  
  <pre><code>var mysql = require('mysql');
  var config = require('./config.json');
  var sql,response;
  
  exports.handler = function(event, context) {
      var connection = mysql.createConnection({
        host     : config.dbhost,
        user     : config.dbuser,
        password : config.dbpassword,
        database : config.dbname
      });
  
  exports.handler = function(event, context,callback) {
     //prevent timeout from waiting event loop
    context.callbackWaitsForEmptyEventLoop = false;
  
     var variable1= event.variable1;
     var variable2= event.variable2;
     var id= event.id;
  
      connection.query('UPDATE LocationData SET latitude = ?,longitude =? WHERE userId = ?', [variable1, variable2,id], function(error, results, fields) {
          response = {};
          response['id'] = results.id;
          response['variable1'] = results.variable1;
          response['variable2'] = results.variable2;
          context.succeed(response);
      });
  
  };
  };
  </code></pre>