Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

express mysql

var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'dbuser',
  password : 's3kreee7'
});

connection.connect();

connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
  if (err) throw err;
  console.log('The solution is: ', rows[0].solution);
});

connection.end();
Source by expressjs.com #
 
PREVIOUS NEXT
Tagged: #express #mysql
ADD COMMENT
Topic
Name
2+2 =