Skip to content

Instantly share code, notes, and snippets.

/file.js Secret

Created September 14, 2017 02:52
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 anonymous/c0f09428a4d1832f67738f83606949e6 to your computer and use it in GitHub Desktop.
Save anonymous/c0f09428a4d1832f67738f83606949e6 to your computer and use it in GitHub Desktop.
...
function getQuote() {
var con = mysql.createConnection({
host: cfg.host,
user: cfg.user,
password: cfg.password,
database: cfg.database
});
con.connect();
console.log("3");
con.query("SELECT quotes FROM quotess ORDER BY RAND() LIMIT 1", function (err, result) {
console.log("4");
// if (err) throw err;
var msg = result[0];
console.log(msg.quotes);
con.end();
return msg.quotes;
});
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment