title: Node.js + mysql data is not entering into database
body: <p>In my node app i am trying to insert data into mysql databse. I am Following this tutorial</p>
  
  <p>"<a href="http://www.tutorialindustry.com/node-js-mysql-tutorial-for-beginners" rel="nofollow">http://www.tutorialindustry.com/node-js-mysql-tutorial-for-beginners</a>"  </p>
  
  <p>My code:</p>
  
  <pre><code>var express = require('express')
  , http = require('http')
  , mysql = require('mysql')
  , path = require('path');
  var app = express();
  // all environments
  app.set('port', process.env.PORT || 3002);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'jade');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.get('/', function( req, res) {
  res.render('index');
  });
  //connect to mysql database
  /*var connection = mysql.createConnection({
  host : '127.0.0.1',
  user : 'root',
  password : 'root',
  database : 'nodejsmysql'
  });
  connection.connect();*/
  
  var connection = mysql.createConnection({
    host     : 'localhost',
    user     : 'root',
    password : 'root',
    database : 'nodejsmysql',
    debug : true,
  })
  connection.connect(function(err) {
      if ( !err ) {
          console.log("Connected to MySQL");
      } else if ( err ) {
          console.log(err);
      }
  });
  app.get('/users', function (req, res) {
  connection.query('select * from nodejs', function(err, docs) {
  res.render('users', {users: docs});
  });
  });
  // Add a new User
  app.get("/users/new", function (req, res) {
  res.render("new");
  });
  // Save the Newly created User
  app.post("/users", function (req, res) {
  var fname=req.body.fname;
  var lname=req.body.lname;
  console.log("qqqqqqqqqq")
  connection.query('INSERT INTO nodejs (fname, lname) VALUES (? , ?);' , [fname, lname], function(err, docs) {
  if (err) res.json(err);
  res.redirect('users');
  });
  });
  http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
  });
  </code></pre>
  
  <p>Not throwing any error.but the datas are not entering into database.</p>