SHARE
TWEET

Untitled

a guest Apr 21st, 2019 105 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mysql = require('mysql');
  2. var connection = mysql.createConnection(
  3.     {
  4.         host : 'localhost',
  5.         user : 'root',
  6.         password : '1234',
  7.         database : 'test'
  8.     }
  9. );
  10.  
  11. connection.connect();
  12.  
  13. connection.query('select * from test_table', function(error, result, fields){
  14.     if(error){
  15.         console.log(error)
  16.     }
  17.     console.log(result);
  18. });
  19.  
  20. connection.end();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top