title: Node.js boolean variable not changing value
body: <p>I have following code:</p>
  
  <pre><code>app.post('/', function (req, res)
      {
          /*
          connection is created with mysql
           */
          var success = true
          connection.query(sql, [values], function (err, result)
          {
              success = false
          })
          connection.end()
          console.log(success)
      }
  )
  </code></pre>
  
  <p>The output of this is <code>true</code>. How do I change the value of success from inside of connection.query?</p>