var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : 'root',
  database : 'xzjwt1211'
});
 
connection.connect();

var sql = 'SELECT * from t_site';
 
connection.query(sql, function (err, results, fields) {
  if (err){
      console.log('[select error - ', err.message);
      return;
  }
  console.log(results[0].remark);
});

 

posted on 2018-02-08 00:53  jarod99  阅读(153)  评论(0编辑  收藏  举报