title: Mysql dynamic query in node.js
body: <p>I am new to this node.js concepts.What i have tried is updating a database and retreiving datas from database(working fine).On further step i returned the output(from database) into an "JSON" format(working fine)..Now my requirement is to have a dynamic query..</p>
  
  <p>Consider:</p>
  
  <p>The following url:</p>
  
  <pre><code>http://xxx.xxx.xx.x:3002/users will retrieve all datas from users table and return in json format
  </code></pre>
  
  <p>But what i want is:</p>
  
  <pre><code>http://xxx.xxx.xx.x:3002/users=abcdef so the datas for that particular user should be returned in json format.
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>app.get('/users', function (req, res) {
      connection.query('select * from nodejs where', function(err, rows, fields) {
          res.writeHead(200, { 'Content-Type': 'application/json'});
          res.end(JSON.stringify(rows));
          //res.render('users', {users: docs});
      });
  });
  </code></pre>
  
  <p>So how can i modify the above code to retrieve only for specific users details..Help me to solve this..Thanks in advance..</p>