Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 64 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. require('dotenv').load();
  2.  
  3. var mysql = require('mysql');
  4.  
  5. var con = mysql.createConnection({
  6.   host: process.env.DB_HOST,
  7.   user: process.env.DB_USERNAME,
  8.   password: process.env.DB_PASSWORD,
  9.   database: process.env.DB_NAME
  10. });
  11.  
  12. con.connect(function(err) {
  13.   if (err) throw err;
  14.   console.log("Connected!");
  15.   var sql = "INSERT INTO tweet_request (device_token, hashtags) VALUES ('ExampleDeviceToken', '#Example #Hashtags')";
  16.   con.query(sql, function (err, result) {
  17.     if (err) throw err;
  18.     console.log("1 record inserted");
  19.     process.exit();
  20.   });
  21. });
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
 
Top