Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = function(){
- var mysql = require('mysql');
- var con = mysql.createConnection({
- host: "localhost",
- user: "root",
- password: "565510202",
- database: "mydb"
- });
- con.connect(function(err) {
- if (err) throw err;
- con.query("SELECT * FROM customers", function (err, result, fields) {
- if (err) throw err;
- console.log(result);
- return result;
- });
- });
- }
- var customersResult = require('./k.js')();
Add Comment
Please, Sign In to add comment