Created
July 6, 2013 09:01
-
-
Save vodolaz095/5939316 to your computer and use it in GitHub Desktop.
nodejs - mysql - json
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 : 'example.org', | |
user : 'bob', | |
password : 'secret', | |
}); | |
connection.query('SELECT * FROM `tbl` ORDER BY `id` DESC', function(err, rows) { | |
console.log(JSON.stringify(rows)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment