Skip to content

Instantly share code, notes, and snippets.

@DennisRas
Created August 16, 2011 21:03
Show Gist options
  • Save DennisRas/1150179 to your computer and use it in GitHub Desktop.
Save DennisRas/1150179 to your computer and use it in GitHub Desktop.
Doesn't work with node.exe
var mysql = require('mysql');
var client = mysql.createClient({
user: 'dennisrasmussen',
password: '****************',
host: '*****************',
database: 'dennisrasmussen',
port: 9000
});
client.query(
'SELECT * FROM chat_users',
function selectCb(err, results, fields) {
if (err) {
throw err;
}
console.log(results);
console.log(fields);
client.end();
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment