Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
test.js 579 Bytes
Copy Edit Raw Blame History
昌同学 authored 2017-08-04 14:55 . 'commit'
var mysql = require('mysql');
var connection;
connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'chang971106',
port: '3306',
database: 'school'
});
connection.connect();
var sql = 'SELECT * FROM course';
//��
connection.query(sql,function (err, result) {
if(err){
console.log('[SELECT ERROR] - ',err.message);
return;
}
console.log('--------------------------SELECT----------------------------');
console.log(result);
console.log('------------------------------------------------------------\n\n');
});
connection.end();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化