title: node.js + mysql Query from url
body: <p>I am new to this node.js. I am using mysql in my node.js. From the url i am constructing sql query. With 1 parameter its working fine.</p>
  
  <p>The URL:</p>
  
  <pre><code>http://ipaddress:3002/users/Kappalur
  </code></pre>
  
  <p>By using the following code i extracted the Kappalur and its working fine:</p>
  
  <pre><code>app.get('/users/:level', function (req, res) {
  
  connection.query("select * from levels where level4= '"+req.params.level+"'", function(err, rows, fields) {
  res.writeHead(200, { 'Content-Type': 'application/json'});
              res.end(JSON.stringify(rows,null,"\n"));
  
  Now my requirement is i want to make "level4" to be dynamic..
  </code></pre>
  
  <p>Consider now the url be:   </p>
  
  <pre><code> http://ipaddress:3002/users/level4/Kappalur
  </code></pre>
  
  <p>Now how can i change the above code to get the 2 parameters from url. Help me to solve this..Thanks in advance.</p>