title: Select Exists always return true in mysql
body: <p>I am trying to make a login form where I have to register user before that. But this code always says that user already exists even if it's not the case. What am I doing wrong?</p>
  
  <pre><code>connection.query("select exists (select * from demoApp where username = '" + username + " ')", function (error, result) {
      if (error) {
          LOG.error(error);
          return;
      }
      else {
          LOG.info(result);
          if (result) {
              LOG.info("Username already exists!");
          }
  
          else {
  
              connection.query("INSERT INTO demoApp (username, password) VALUES( '" + username + "', '" + password + "')", function (error, result) {
                  if (error) {
                      LOG.error(error);
  
                      return;
                  }
                  else {
                      LOG.info("Username added.");
  
                  }
              });
          }
      }
  });
  </code></pre>
  
  <p>};</p>