What do you want to save?
Add Code snippet
New code examples
-
Java 2022-03-04 10:15:08
interact with databse java
const mysql = require('mysql'); const con = mysql.createConnection({ host: "localhost", user: "yourusername", password: "yourpassword" }); con.connect(function(err) { if (err) throw err; &n... Add solution -
Javascript 2022-02-02 18:46:21
connection.escape
var mysql = require('mysql'); var connection = mysql.createConnection({ host: 'localhost', user: 'root', password: '', database: 'technicalkeeda', debug: false,});connection.connect(); var employeeId = '1';var sql = "SELECT *... Add solution -
SQL 2021-11-18 00:22:09
async await mysql nodejs
const mysql = require('mysql'); // or use import if you use TS const util = require('util'); const conn = mysql.createConnection({yourHOST/USER/PW/DB}); // node native promisify const query = util.promisify(conn.query).bind(conn); (async () => { tr... Add solution -
Javascript 2021-10-17 10:31:10
sql expressjs update query
var mysql = require('mysql'); var con = mysql.createConnection({ host: "localhost", user: "yourusername", password: "yourpassword", database: "mydb" }); con.connect(function(err) { if (err) throw err; ... Add solution -
Javascript 2021-09-23 01:45:03
create server and connect to db and frontend
// create directory //npm init -y //npm i express --save //npm i mysql --save //create public directory //create server.js // <---- In the server js file ---> 'use strict'; const express = require('express'); const app = express(); app.use(expre... Add solution -
Javascript 2021-08-29 08:10:01
javascript interact with database
// Javascript connect to ddb: const mysql = require('mysql'); const con = mysql.createConnection({ host: "localhost", user: "yourusername", password: "yourpassword" }); con.connect(function(err) { if (err) th... Add solution -
SQL 2021-08-27 12:42:01
create database dynamically sql server using sequalize
const config = require('config.json'); const mysql = require('mysql2/promise'); const { Sequelize } = require('sequelize'); module.exports = db = {}; initialize(); async function initialize() { // create db if it doesn't already exist const { h... Add solution