Created
October 13, 2012 08:16
-
-
Save MiLk/3883780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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