title: How to display result a mysql query in node.js
body: <p>I'm trying to display the result of my query using res.end but i can't since i'm new to Node.js,Here's part of my code where the user enters the username and password in a form in an html file and i want to display the result of a query which is the username but what i'm getting is the all rows in the database table :</p>
  
  <pre><code>     app.post('/login/:email', function (req, res){
        connection.connect();
        email = req.body.email;
        password = req.body.password;
       if(email &amp;&amp; password )
       {
       console.log(email);
       console.log(password);
     connection.query('SELECT username FROM user WHERE email = email and password = password', function     (error, rows, fields) { 
  
          str='';
          for(i=0;i&lt;rows.length;i++)
          str = str + rows[i].username +'\n';
           res.end( str);
  
  
        }); 
        connection.end(); 
       } 
  });
  </code></pre>