public
Created

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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);
});
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.