Skip to content

Instantly share code, notes, and snippets.

@MiLk
Created October 13, 2012 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiLk/3883780 to your computer and use it in GitHub Desktop.
Save MiLk/3883780 to your computer and use it in GitHub Desktop.
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : '',
database : 'watchat',
});
connection.connect();
module.exports.query = function (query,cb) {
var res = mysql.query(query, function(err, result, fields) {
console.log(result);
if (err) throw err;
else cb(result);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment