Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //const con = require( "./connection");
- const mysql = require( 'mysql');
- const conf = require( '../config.json');
- module.exports = {
- insertIntoDB: (quoteName, messageID, note) => {
- const con = mysql.createConnection({
- host : conf.host,
- user : conf.user,
- password : conf.password,
- database : conf.database
- })
- con.connect(err => {
- if (err) throw err;
- console.log("Connected!");
- var sql = "INSERT INTO quotes (`quoteName`, `messageID`, `note`) VALUES ('"+quoteName+"','"+ messageID+"','"+note+"')";
- con.query(sql, (err, result) => {
- if (err) throw err;
- console.log("1 record inserted, ID: " + result.id);
- })
- })
- }
- }
- // export function insertIntoDB(quoteName, channelID, messageID, note) {
- // }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement