Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connection.query('insert into username (name) values ("msg")', function(err, rows, fields) {
- if(!err) {
- } });
- connection.query('insert into username (name) values '+ msg, function(err, rows, fields) {
- if(!err) {
- } });
- 'insert into username (name) values hello world'
- var util - require('util');
- var mySql = util.format('insert into username (name) values ("%s")', 'hello world');
- connection.query(mySql, function(err, rows, fields) {
- if(!err) {
- } });
- const connection = mysql.createConnection({
- host: 'localhost',
- user: 'root',
- password: 'pass',
- database: 'db_name'
- });
- connection.query(`INSERT INTO user_table (name, mail, pass) VALUES ('${user_name}', '${user_name}', '${user_name}');`, function (err, result, fields) {
- if (err) throw err;
- });
Add Comment
Please, Sign In to add comment