-
-
Save KuJoe/7615a1448d7ec4cb44ae5e504a9f1652 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
function getRuin(data, callback) { | |
var con = mysql.createConnection({ | |
host: cfg.host, | |
user: cfg.user, | |
password: cfg.password, | |
database: cfg.database | |
}); | |
con.connect(); | |
console.log("3"); | |
con.query("SELECT ruin FROM ruins ORDER BY RAND() LIMIT 1", function (err, result) { | |
console.log("4"); | |
// if (err) throw err; | |
var msg = result[0]; | |
// console.log(msg.ruin); | |
return callback(msg.ruin); | |
con.end(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment