What changes should i need to make to run this simple program
var http = require('http')
var mysql = require('mysql');
var client = mysql.createConnection({
host: 'localhost',
user: 'root'
});
client.query('USE node');
http.createServer(function (request, response)
{
request.on('end', function ()
{
connection.query('SELECT id, content FROM test WHERE id IN (?, ?)',[1, 2], function(err, results, fields)
{
response.end(JSON.stringify(results));
});
});
}).listen(8080);
Thanks