Created
March 29, 2017 11:15
-
-
Save lucaspg96/1ec1cca9c2481f2be364829f578b5674 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: process.env.USER_MYSQL, | |
password: process.env.PASS_MYSQL, | |
database: "test" | |
}) | |
connection.connect() | |
connection.query('SELECT * from contacts',function(err,rows,fields){ | |
if (err) { | |
console.log("Error!") | |
} | |
else{ | |
console.log(rows) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment