Created
November 1, 2017 17:45
-
-
Save hackmods/97d320c16a549ab43bd2357898a50dae to your computer and use it in GitHub Desktop.
This file contains hidden or 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 : 'Passphrase', | |
database : 'mydatabase' | |
}); | |
connection.connect() | |
connection.query('SELECT * from temp', function (err, rows, fields) { | |
if (err) throw err | |
console.log('The solution is: ', rows[2].name , ' ' , rows[2].index) | |
}) | |
connection.end() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment