- var mysql = require('mysql');
- var connection = mysql.createConnection({
- host: 'localhost',
- user: 'root',
- password: '',
- database: 'technicalkeeda',
- debug: false,
- multipleStatements: true
- });
- connection.connect();
- var sql = "SELECT * FROM trn_employee WHERE employee_id = ?;SELECT * FROM trn_person WHERE person_id = ?";
- connection.query(sql, [2, 1], function(error, results, fields) {
- if (error) {
- throw error;
- }
- console.log(results[0]);
- console.log(results[1]);
- });
- connection.end();
- [ { employee_id: 2, first_name: 'Dinesh', last_name: 'Patil' } ]
- [ { person_id: 1, first_name: 'Yashwant', last_name: 'Chavan', age: 10 } ]
Không có nhận xét nào:
Đăng nhận xét