The code connects to a database, and then queries it for information. If there are any errors, they are thrown. The resulting output will show the connected status and the results of the query.
Shortcut: js.mysql.query
con.connect(function(err) {
if (err) throw err;
console.log("Connected!");
con.query(sql, function (err, result) {
if (err) throw err;
console.log("Result: " + result);
});
});